Skip to content

Commit

Permalink
Use actuator_number for JPC.
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Co-authored-by: Michael Carroll <mjcarroll@intrinsic.ai>
  • Loading branch information
bperseghetti and mjcarroll committed Apr 28, 2023
1 parent 12babc9 commit b7671af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ void JointPositionController::Configure(const Entity &_entity,
if (_sdf->HasElement("use_actuator_msg") &&
_sdf->Get<bool>("use_actuator_msg"))
{
if (_sdf->HasElement("actuatorNumber"))
if (_sdf->HasElement("actuator_number"))
{
this->dataPtr->actuatorNumber =
_sdf->Get<int>("actuatorNumber");
_sdf->Get<int>("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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ namespace systems
/// The default value is 0.
///
/// `<use_actuator_msg>` True to enable the use of actutor message
/// for position command. Relies on `<actuatorNumber>` for the
/// for position command. Relies on `<actuator_number>` for the
/// index of the position actuator and defaults to topic "/actuators".
///
/// `<actuatorNumber>` used with `<use_actuator_commands>` to set
/// `<actuator_number>` used with `<use_actuator_commands>` to set
/// the index of the position actuator.
///
/// `<p_gain>` The proportional gain of the PID. Optional parameter.
Expand Down
2 changes: 1 addition & 1 deletion test/worlds/joint_position_controller_actuators.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
name="gz::sim::systems::JointPositionController">
<joint_name>j1</joint_name>
<use_actuator_msg>true</use_actuator_msg>
<actuatorNumber>0</actuatorNumber>
<actuator_number>0</actuator_number>
</plugin>
</model>
</world>
Expand Down

0 comments on commit b7671af

Please sign in to comment.