13 using namespace mvsim;
19 setpoint_lin_speed(0),
20 setpoint_ang_speed(0),
56 std::vector<mrpt::math::TPoint2D>
58 m_veh.getWheelsVelocityLocal(
61 ASSERT_(desired_wheel_vels.size() == 4);
65 double vel_fl, vel_fr;
66 double desired_fl_steer_ang, desired_fr_steer_ang;
67 m_veh.computeFrontWheelAngles(
68 co.
steer_ang, desired_fl_steer_ang, desired_fr_steer_ang);
70 const mrpt::poses::CPose2D wRotInv(0, 0, -desired_fl_steer_ang);
71 mrpt::math::TPoint2D vel_w;
77 const mrpt::poses::CPose2D wRotInv(0, 0, -desired_fr_steer_ang);
78 mrpt::math::TPoint2D vel_w;
86 double act_vel_fl, act_vel_fr;
88 std::vector<mrpt::math::TPoint2D>
90 m_veh.getWheelsVelocityLocal(
91 odo_wheel_vels,
m_veh.getVelocityLocalOdoEstimate());
92 ASSERT_(odo_wheel_vels.size() == 4);
94 const double actual_fl_steer_ang =
96 const double actual_fr_steer_ang =
100 const mrpt::poses::CPose2D wRotInv(0, 0, -actual_fl_steer_ang);
101 mrpt::math::TPoint2D vel_w;
102 wRotInv.composePoint(
104 act_vel_fl = vel_w.x;
107 const mrpt::poses::CPose2D wRotInv(0, 0, -actual_fr_steer_ang);
108 mrpt::math::TPoint2D vel_w;
109 wRotInv.composePoint(
111 act_vel_fr = vel_w.x;
116 for (
int i = 0; i < 2; i++)
135 std::map<std::string, TParamEntry> params;
181 "] Teleop keys: w/s=incr/decr lin speed. " 182 "a/d=left/right steering. spacebar=stop.\n";
virtual void teleop_interface(const TeleopInput &in, TeleopOutput &out)
double max_torque
Maximum abs. value torque (for clamp) [Nm].
virtual void control_step(const DynamicsAckermann::TControllerInput &ci, DynamicsAckermann::TControllerOutput &co)
double setpoint_ang_speed
desired velocities (m/s) and (rad/s)
double KD
PID controller parameters.
virtual void teleop_interface(const TeleopInput &in, TeleopOutput &out) override
void parse_xmlnode_children_as_param(const rapidxml::xml_node< char > &xml_node, const std::map< std::string, TParamEntry > ¶ms, const char *function_name_context="")
double setpoint_lin_speed
virtual void load_config(const rapidxml::xml_node< char > &node)
double max_out
For clamping (0=no clamp)
double compute(double err, double dt)
double steer_ang
Equivalent ackerman steering angle.
std::string append_gui_lines
static const char * class_name()
ControllerTwistFrontSteerPID(DynamicsAckermann &veh)