How to operate Rosbot3 pro wheels with CLI?

If possible I would like to operate the Rosbot3 pro wheels directly from a terminal. I tried commands like this one : ros2 topic pub /_motors_cmd std_msgs/msg/Float32MultiArray “data: [1.0, 1.0, 1.0, 1.0]”

but it has no action on wheels . Could you please tell me how to proceed ?

Hello @Lionel,

From what I see, the message Float32MultiArray also contains a layout field, which, if I recall correctly, must be explicitly filled in.

ros2 topic pub /_motors_cmd std_msgs/msg/Float32MultiArray "layout:
dim: []
data_offset: 0
data: [1.0, 1.0, 1.0, 1.0]"

I would like to ask you for confirmation.

It has not effect :frowning:. The message is published repetitively (according the prompt) but wheel are not rotating.

I checked, the following command works:

ros2 topic pub /_motors_cmd std_msgs/msg/Float32MultiArray 'layout:
dim: []
data_offset: 0
data: [0.5, 0.5, 0.5, 0.5]
'

However, it’s important to ensure there are no resource conflicts. The default ROS driver uses the differential/mecanum drive_conntroller, which, if there’s no data on /cmd_vel, publishes zeros to topic /_motors_cmd (check ros2 topic echo /_motors_cmd). Therefore, since this isn’t a core functionality, there’s no way to disable this node other than build driver from source and editing the launch settings in rosbot_controller.

Thank you for your quick answer.

Hello,

I tried to open the link in your message, but github thinks it’s dead.

Also, I’m sorry for the possibly dumb question, but I don’t understand how you state that the command works, and at the same time that it’s impossible to run it due to resources conflicts in the first place.

Hi @pbruneau,

That’s strange, because it doesn’t report an error in the link. I’m uploading the entire file: https://github.com/husarion/rosbot_ros/blob/humble/rosbot_controller/launch/controller.launch.py

You can increase the frequency of publication (-r flag) of messages and observe jerky movement of the robot.

Regarding the file: I realized I’m getting the github unicorn for many files and repos, it seems that they go through issues currently - my bad