From b7671af959743aef99bbff667ed7bbec951cd4a7 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Thu, 27 Apr 2023 20:09:32 -0400 Subject: [PATCH] Use actuator_number for JPC. Signed-off-by: Benjamin Perseghetti Co-authored-by: Michael Carroll --- .../joint_position_controller/JointPositionController.cc | 6 +++--- .../joint_position_controller/JointPositionController.hh | 4 ++-- test/worlds/joint_position_controller_actuators.sdf | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/systems/joint_position_controller/JointPositionController.cc b/src/systems/joint_position_controller/JointPositionController.cc index b0539fc7a0..0d0d42d161 100644 --- a/src/systems/joint_position_controller/JointPositionController.cc +++ b/src/systems/joint_position_controller/JointPositionController.cc @@ -205,15 +205,15 @@ void JointPositionController::Configure(const Entity &_entity, if (_sdf->HasElement("use_actuator_msg") && _sdf->Get("use_actuator_msg")) { - if (_sdf->HasElement("actuatorNumber")) + if (_sdf->HasElement("actuator_number")) { this->dataPtr->actuatorNumber = - _sdf->Get("actuatorNumber"); + _sdf->Get("actuator_number"); this->dataPtr->useActuatorMsg = true; } else { - gzerr << "Please specify an actuatorNumber" << + gzerr << "Please specify an actuator_number" << "to use Actuator position message control." << std::endl; } } diff --git a/src/systems/joint_position_controller/JointPositionController.hh b/src/systems/joint_position_controller/JointPositionController.hh index 74cb58e36d..af139641d7 100644 --- a/src/systems/joint_position_controller/JointPositionController.hh +++ b/src/systems/joint_position_controller/JointPositionController.hh @@ -53,10 +53,10 @@ namespace systems /// The default value is 0. /// /// `` True to enable the use of actutor message - /// for position command. Relies on `` for the + /// for position command. Relies on `` for the /// index of the position actuator and defaults to topic "/actuators". /// - /// `` used with `` to set + /// `` used with `` to set /// the index of the position actuator. /// /// `` The proportional gain of the PID. Optional parameter. diff --git a/test/worlds/joint_position_controller_actuators.sdf b/test/worlds/joint_position_controller_actuators.sdf index e65eb698c3..5818a79ec7 100644 --- a/test/worlds/joint_position_controller_actuators.sdf +++ b/test/worlds/joint_position_controller_actuators.sdf @@ -116,7 +116,7 @@ name="gz::sim::systems::JointPositionController"> j1 true - 0 + 0