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

Velocity command interface #694

Closed
fafux opened this issue May 25, 2023 · 5 comments
Closed

Velocity command interface #694

fafux opened this issue May 25, 2023 · 5 comments
Labels
solution proposed A solution has been proposed

Comments

@fafux
Copy link

fafux commented May 25, 2023

Hi,
I am trying to control an UR robot both in simulation and with the real hardware with the command interface in velocity with ROS2 foxy. The values of the joint velocities states, in simulation, are changing but the robot is not moving. While if I try to move the robot using the position command interface I can do it.
Is it possible to move the robot only using the velocity command interface? If so, is there any example on how to do it?
Thanks.

@fmauch
Copy link
Collaborator

fmauch commented Jun 6, 2023

For Foxy, velocity commands have not been implemented. We suggest to use ROS 2 humble, since Foxy is end of life by now.

For humble, a forwarding velocity controller is built in and simply has to be activated using the ros2 control switch_controllers cli tool. To use it, there is a test motion script ros2 launch ur_robot_driver test_forward_velocity_controller.launch.py which runs this script

tldr:
While the robot is running, do

ros2 control load_controller forward_velocity_controller
ros2 control set_controller_state forward_velocity_controller inactive
ros2 control switch_controllers --deactivate scaled_joint_trajectory_controller --activate forward_velocity_controller

# start motion
ros2 topic pub --once /forward_velocity_controller/commands std_msgs/msg/Float64MultiArray "{data:[0,0,0,0,0,0.1]}"

# stop motion
ros2 topic pub --once /forward_velocity_controller/commands std_msgs/msg/Float64MultiArray "{data:[0,0,0,0,0,0.0]}"

@fafux
Copy link
Author

fafux commented Jun 6, 2023

Thanks for the clarification.

@fafux fafux closed this as completed Jun 6, 2023
@fafux
Copy link
Author

fafux commented Jun 30, 2023

Hi,

I am using ROS2 humble and I follow your instructions:

ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur10e robot_ip:=yyy.yyy.yyy.yyy initial_joint_controller:=scaled_joint_trajectory_controller use_fake_hardware:=true launch_rviz:=true
ros2 control load_controller forward_velocity_controller
ros2 control set_controller_state forward_velocity_controller inactive
ros2 control switch_controllers --deactivate scaled_joint_trajectory_controller --activate forward_velocity_controller
ros2 topic pub --once /forward_velocity_controller/commands std_msgs/msg/Float64MultiArray "{data:[0,0,0,0,0,0.1]}"

but the robot is not moving.

@fafux fafux reopened this Jun 30, 2023
@fmauch
Copy link
Collaborator

fmauch commented Jul 3, 2023

Confirmed that with fake hardware this does not work. With URSim / a real robot this works, however.

@fafux fafux closed this as completed Jul 12, 2023
@fmauch
Copy link
Collaborator

fmauch commented Jul 28, 2023

As a comment: Velocity mode for mock_hw is currently being implemented in ros2_control: ros-controls/ros2_control#1028

I've just tested this and with that the robot is indeed moving on velocity commands.

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

No branches or pull requests

2 participants