Skip to content

Commit

Permalink
Add description on mock_gpio_commands
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Feb 15, 2024
1 parent dff19a4 commit a7cd009
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions hardware_interface/doc/mock_components_userdoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Features:
- support for mimic joints, which is parsed from the URDF (see the `URDF wiki <http://wiki.ros.org/urdf/XML/joint>`__)
- mirroring commands to states with and without offset
- fake command interfaces for setting sensor data from an external node (combined with a :ref:`forward controller <forward_command_controller_userdoc>`)
- fake gpio interfaces for setting sensor data from an external node (combined with a :ref:`forward controller <forward_command_controller_userdoc>`)


Parameters
Expand All @@ -36,6 +37,10 @@ mock_sensor_commands (optional; boolean; default: false)
Creates fake command interfaces for faking sensor measurements with an external command.
Those interfaces are usually used by a :ref:`forward controller <forward_command_controller_userdoc>` to provide access from ROS-world.

mock_gpio_commands (optional; boolean; default: false)
Creates fake command interfaces for faking GPIO states with an external command.
Those interfaces are usually used by a :ref:`forward controller <forward_command_controller_userdoc>` to provide access from ROS-world.

position_state_following_offset (optional; double; default: 0.0)
Following offset added to the commanded values when mirrored to states.

Expand Down
2 changes: 1 addition & 1 deletion hardware_interface/src/mock_components/generic_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,13 @@ return_type GenericSystem::read(const rclcpp::Time & /*time*/, const rclcpp::Dur
mirror_command_to_state(sensor_states_, sensor_mock_commands_);
}

// do loopback on all gpio interfaces
if (use_mock_gpio_command_interfaces_)
{
mirror_command_to_state(gpio_states_, gpio_mock_commands_);
}
else
{
// do loopback on all gpio interfaces
mirror_command_to_state(gpio_states_, gpio_commands_);
}

Expand Down

0 comments on commit a7cd009

Please sign in to comment.