12 #include <mrpt/math/TPoint2D.h> 46 const std::string& _name,
const mrpt::math::TPoint2D& _pos)
52 mrpt::math::TPoint2D
pos;
58 {
"l_wheel", {0.0, 0.5}},
59 {
"r_wheel", {0.0, -0.5}},
65 World*
parent,
const std::vector<ConfigPerWheel>& cfgPerWheel);
79 double wheel_torque_l = 0;
80 double wheel_torque_r = 0;
95 double setpoint_wheel_torque_l = 0, setpoint_wheel_torque_r = 0;
97 double setpoint_teleop_steps = 5e-2;
99 virtual void control_step(
102 virtual void teleop_interface(
114 virtual void control_step(
119 virtual void teleop_interface(
123 double KP = 10, KI = 0, KD = 0;
126 double max_torque = 100;
133 setpointMtx_.unlock();
142 setpointMtx_.unlock();
147 double distWheels_ = 0;
148 std::array<PID_Controller, 2>
PIDs_;
149 mrpt::math::TTwist2D setpoint_{0, 0, 0};
167 virtual void teleop_interface(
175 setpointMtx_.unlock();
184 setpointMtx_.unlock();
189 double distWheels_ = 0;
190 mrpt::math::TTwist2D setpoint_{0, 0, 0};
230 {
"l_wheel", {0.0, 0.5}},
231 {
"r_wheel", {0.0, -0.5}},
232 {
"caster_wheel", {0.5, 0.0}},
246 {
"lr_wheel", {0.0, 0.5}},
247 {
"rr_wheel", {0.0, -0.5}},
248 {
"lf_wheel", {0.5, 0.5}},
249 {
"rf_wheel", {0.5, -0.5}},
ConfigPerWheel(const std::string &_name, const mrpt::math::TPoint2D &_pos)
bool setTwistCommand(const mrpt::math::TTwist2D &t) override
ControllerBase::Ptr & getController()
ControllerBase::Ptr controller_
The installed controller.
virtual void dynamics_load_params_from_xml(const rapidxml::xml_node< char > *xml_node) override
DynamicsDifferential(World *parent)
virtual std::vector< double > invoke_motor_controllers(const TSimulContext &context) override
geometry_msgs::TransformStamped t
static const char * class_name()
virtual void invoke_motor_controllers_post_step(const TSimulContext &context) override
DynamicsDifferential_3_wheels(World *parent)
bool setTwistCommand(const mrpt::math::TTwist2D &t) override
virtual ControllerBaseInterface * getControllerInterface() override
std::shared_ptr< ControllerBaseTempl< VEH_DYNAMICS > > Ptr
std::array< PID_Controller, 2 > PIDs_
ControllerRawForces(DynamicsDifferential &veh)
#define DECLARES_REGISTER_VEHICLE_DYNAMICS(CLASS_NAME)
DynamicsDifferential_4_wheels(World *parent)
static const char * class_name()
virtual mrpt::math::TTwist2D getVelocityLocalOdoEstimate() const override
static const char * class_name()
const std::vector< ConfigPerWheel > configPerWheel_
Defined at ctor time:
mrpt::math::TTwist2D setpoint() const
mrpt::math::TTwist2D setpoint() const
const ControllerBase::Ptr & getController() const