📄 carchassis.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 generic car chassis * Author: Andrew Howard * Date: 23 Oct 2004 * CVS: $Id: CarChassis.hh,v 1.1 2004/10/24 17:54:18 inspectorg Exp $ */#ifndef CARCHASSIS_HH#define CARCHASSIS_HH#include "Model.hh"// Forward declarationsclass Body;class HingeJoint;class Hinge2Joint;class Geom;typedef struct gz_position gz_position_t;/// @brief A generic car chassisclass CarChassis : public Model{ /// @brief Construct public: CarChassis( World *world ); /// @brief Destructor public: virtual ~CarChassis(); /// @brief Load the model public: virtual int Load( WorldFile *file, WorldFileNode *node ); /// @brief Load ODE stuff private: int OdeLoad( WorldFile *file, WorldFileNode *node ); /// @brief Initialize the model public: virtual int Init( WorldFile *file, WorldFileNode *node ); /// @brief Finalize the model public: virtual int Fini(); /// @brief Update the model state public: virtual void Update( double step ); // Get commands from the position interface private: void PositionGetCmd(); // Update the position interface private: void PositionPutData(); // ODE components private: Body *chassis; private: Body *frontLeftWheel, *frontRightWheel; private: Body *rearLeftWheel, *rearRightWheel; private: HingeJoint *rearLeftJoint, *rearRightJoint; private: Hinge2Joint *frontLeftJoint, *frontRightJoint; // Time of last update private: double updateTime; // External interface private: gz_position_t *position; // Command settings private: double cmdSpeed, cmdSteer; // Steering limits private: double steerMaxAngle; // Steering controller private: double steerKp, steerKd;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -