Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock hardware forward_velocity_controller not working #998

Open
atticusrussell opened this issue Apr 24, 2023 · 1 comment
Open

Mock hardware forward_velocity_controller not working #998

atticusrussell opened this issue Apr 24, 2023 · 1 comment
Labels

Comments

@atticusrussell
Copy link

Describe the bug
Mock hardware does not work with forward_velocity_controller.

To Reproduce
Steps to reproduce the behavior:

  1. in the src directory of a ros workspace run
git clone https://github.com/atticusrussell/ros2_control_demos/tree/mock_fwd_vel_cont
  1. from the root of the workspace build the package:
colcon build --symlink-install --packages-select ros2_control_demo_example_3
  1. source the build :
source install/setup.bash
  1. Launch the ros2_control_demo example 3 file configured to use mock hardware (with the forward_velocity_controller loaded to begin with, which is unchanged from the example):
ros2 launch ros2_control_demo_example_3 rrbot_system_mock_multi_interface.launch.py
  1. in another terminal with the workspace sourced, paste the velocity command from the example 3 tutorial that should control the rrbot
ros2 topic pub /forward_velocity_controller/commands std_msgs/msg/Float64MultiArray "data:
- 5
- 5" 
  1. Observe that in the rviz2 window, there is no movement of the rrbot. I believe this is because mock hardware doesn't work with forward velocity control. I discovered this while working on a different robot, but figured using one of the examples would be the easiest way to demonstrate it.
  2. To show that position control works with mock hardware, stop the previous command in the 2nd terminal window with ctrl+c and run the following:
ros2 control load_controller forward_position_controller --set-state active

NOTE: the following only works if you set the state as active when loading, despite the fact that there will be a warning due to trying to activate twice. I should probably file another issue about that.

ros2 control switch_controllers --activate forward_position_controller --deactivate forward_velocity_controller

paste the position command from the example 3 tutorial:

ros2 topic pub /forward_position_controller/commands std_msgs/msg/Float64MultiArray "data:
- 0.5
- 0.5"

Expected behavior
I expect that the mock forward velocity control would work the same as running the following, minus being spammed with terminal output:

  1. close all previous commands, and run (again in a window with the ws built and sourced)
ros2 launch ros2_control_demo_example_3 rrbot_system_multi_interface.launch.py
  1. in a second terminal window, run the same velocity command as before
ros2 topic pub /forward_velocity_controller/commands std_msgs/msg/Float64MultiArray "data:
- 5
- 5" 
  1. observe the rrbot moving according to the command

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Version: ROS2 Humble
  • running on WSL2

Additional context
ros2_control has not been modified.

$ apt info ros-humble-ros2-control
Package: ros-humble-ros2-control
Version: 2.24.1-1jammy.20230327.051647
Priority: optional
Section: misc
Maintainer: Bence Magyar <bence.magyar.robotics@gmail.com>
Installed-Size: 43.0 kB
Depends: ros-humble-controller-interface, ros-humble-controller-manager, ros-humble-controller-manager-msgs, ros-humble-hardware-interface, ros-humble-joint-limits, ros-humble-ros2-control-test-assets, ros-humble-ros2controlcli, ros-humble-transmission-interface, ros-humble-ros-workspace
Download-Size: 6,106 B
APT-Manual-Installed: yes
APT-Sources: http://packages.ros.org/ros2/ubuntu jammy/main amd64 Packages
Description: Metapackage for ROS2 control related packages
@christophfroehlich
Copy link
Contributor

Might this be a consequence of #885 ? (no integration of velocity to position interfaces)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants