📄 peoplebot.hh
字号:
/* * Gazebo - Outdoor Multi-Robot Simulator * Copyright (C) 2003 * Nate Koenig & Andrew Howard * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *//* Desc: Model for a PeopleBot header file * Author: Konstantinos Karantzis */#ifndef PEOPLEBOT_HH#define PEOPLEBOT_HH#include "Body.hh"#include "Model.hh"// Forward declarationsclass Body;class HingeJoint;class BallJoint;class RayProximity;class PeopleBot : public Model{ // Construct, destructor public: PeopleBot( World *world ); public: virtual ~PeopleBot(); // Load the model public: virtual int Load( WorldFile *file, WorldFileNode *node ); // Initialize the model public: virtual int Init( WorldFile *file, WorldFileNode *node ); // Finalize the model public: virtual int Fini(); // Update the model state public: virtual void Update( double step ); // Load ODE stuff private: int LoadODE( WorldFile *file, WorldFileNode *node ); // Load sonar stuff private: int LoadSonar( WorldFile *file, WorldFileNode *node ); // Update the odometry private: void UpdateOdometry( double step ); // Get commands from the external interface private: void GetPositionCmd(); // Update the data in the external interface private: void PutPositionData(); // Update the data in the power interface private: void PutPowerData(); // Update the data in the sonar interface private: void PutSonarData(); // Update parameters private: double updatePeriod, updateTime; // Robot parameters private: double wheelSep, wheelDiam; // Sonar configuration private: double sonarMaxRange; private: GzVector pos[16]; private: double dir[16]; // ODE components private: Body *chassis; private: Body *wheels[2]; private: HingeJoint *wheelJoints[3]; private: Body *castorWheel; private: BallJoint *castorJoint; // Sensor for sonar ranging private: RayProximity *sonarSensor; // External interface private: gz_position_t *position_iface; private: gz_power_t *power_iface; private: gz_sonar_t *sonar_iface; // Wheel speeds (left and right wheels are paired) private: int enableMotors; private: double wheelSpeed[2]; // Odometric pose estimate private: double odomPose[3]; // Odometric speed estimate private: double odomVel[3]; // Battery level private: double batteryLevel; // Coefficients of battery discharge curve private: double batteryCurve[2];};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -