25 "implementation_id",
"JoystickController",
26 "type_name",
"JoystickController",
27 "description",
"Controller to drive a mobile robot",
30 "category",
"OpenHRP Controller",
31 "activity_type",
"DataFlowComponent",
34 "lang_type",
"compile",
40 :
RTC::DataFlowComponentBase(manager),
42 m_angleIn(
"angle", m_angle),
43 m_velocityIn(
"velocity", m_velocity),
44 m_commandIn(
"command", m_command),
45 m_torqueOut(
"torque", m_torque),
129 double steerAngle =
m_angle.data[0];
135 double steerCommandAngle = 3.14159 * -0.5 *
m_command.data[0] / 180.0;
136 double tireCommandVel =
m_command.data[1] / 10;
139 double steerCommandTorque = 20.0 * (steerCommandAngle - steerAngle) - 2.0 * steerVel;
142 double tireCommandTorque = 1.0 * (tireCommandVel - tireVel);
145 m_torque.data[0] = steerCommandTorque;
146 m_torque.data[1] = tireCommandTorque;
147 m_torque.data[2] = tireCommandTorque;
148 m_torque.data[3] = tireCommandTorque;
197 manager->registerFactory(
profile,
198 RTC::Create<JoystickController>,
199 RTC::Delete<JoystickController>);