Factor-Robotics / odrive_ros2_control

ODrive driver for ros2_control
Apache License 2.0
250 stars 82 forks source link

y have a problem when try use diff drive controller #16

Closed Gilocho closed 2 years ago

Gilocho commented 2 years ago

Hello everyone, I am trying to make a differential robot, with odrive I currently install version 0.5.3 because 0.5.4 did not work with their library, but I was able to try the example they have without problems. but when trying to change and use diff_drive_controller I always get the same:

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [22716]
[INFO] [robot_state_publisher-2]: process started with pid [22718]
[INFO] [spawner.py-3]: process started with pid [22720]
[INFO] [spawner.py-4]: process started with pid [22722]
[robot_state_publisher-2] Parsing robot urdf xml string.
[robot_state_publisher-2] Link base_link had 4 children
[robot_state_publisher-2] Link caster_frontal_wheel had 0 children
[robot_state_publisher-2] Link caster_rear_wheel had 0 children
[robot_state_publisher-2] Link left_wheel had 0 children
[robot_state_publisher-2] Link right_wheel had 0 children
[robot_state_publisher-2] [INFO] [1648330252.914258134] [robot_state_publisher]: got segment base_link
[robot_state_publisher-2] [INFO] [1648330252.914436006] [robot_state_publisher]: got segment caster_frontal_wheel
[robot_state_publisher-2] [INFO] [1648330252.914466840] [robot_state_publisher]: got segment caster_rear_wheel
[robot_state_publisher-2] [INFO] [1648330252.914489942] [robot_state_publisher]: got segment dummy
[robot_state_publisher-2] [INFO] [1648330252.914506869] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-2] [INFO] [1648330252.914523963] [robot_state_publisher]: got segment right_wheel
[ros2_control_node-1] terminate called after throwing an instance of 'std::out_of_range'
[ros2_control_node-1]   what():  _Map_base::at
[spawner.py-3] [INFO] [1648330253.238620636] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648330253.382559544] [spawner_mk2_base_controller]: Waiting for /controller_manager services
[ERROR] [ros2_control_node-1]: process has died [pid 22716, exit code -6, cmd '/home/paloverde/mk2_ros2/install/controller_manager/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_k2w8y3jv --params-file /home/paloverde/mk2_p2/install/odrive_bringup/share/odrive_bringup/config/odrive_diff__controllers.yaml'].
[spawner.py-3] [INFO] [1648330255.258554065] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648330255.403404351] [spawner_mk2_base_controller]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1648330257.279708970] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648330257.424464528] [spawner_mk2_base_controller]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1648330259.301082063] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648330259.446024642] [spawner_mk2_base_controller]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1648330261.322128338] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648330261.466963012] [spawner_mk2_base_controller]: Waiting for /controller_manager services
[spawner.py-3] [ERROR] [1648330263.343010495] [spawner_joint_state_broadcaster]: Controller manager not available
[ERROR] [spawner.py-3]: process has died [pid 22720, exit code 1, cmd '/home/paloverde/mk2_ros2/install/controller_manager/lib/controller_manager/spawner.py joint_state_broadcaster --ros-args'].
[spawner.py-4] [ERROR] [1648330263.487450622] [spawner_mk2_base_controller]: Controller manager not available
[ERROR] [spawner.py-4]: process has died [pid 22722, exit code 1, cmd '/home/paloverde/mk2_ros2/install/controller_manager/lib/controller_manager/spawner.py mk2_base_controller --ros-args'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-2] [INFO] [1648330266.007189717] [rclcpp]: signal_handler(signal_value=2)
[INFO] [robot_state_publisher-2]: process has finished cleanly [pid 22718]

also use the example from: rosbot with the same result.

Has anyone had a similar problem? Or do you know what could be causing this problem?

thanks for you help

wilcobonestroo commented 2 years ago

I have similar behavior when I run the basic example from the wiki. The spawner.py for both joint1_controller and joint1_controller say controller manager not available and then stop working.

[INFO] [launch]: All log files can be found below /home/wilco/.ros/log/2022-03-29-16-22-57-194465-wilco-HP-ZBook-15-G6-13355
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [13359]
[INFO] [robot_state_publisher-2]: process started with pid [13361]
[INFO] [spawner.py-3]: process started with pid [13363]
[INFO] [spawner.py-4]: process started with pid [13368]
[ros2_control_node-1] Process /opt/ros/foxy/lib/controller_manager/ros2_control_node created; pid = 13370
[ros2_control_node-1] Listening on port 3000
[robot_state_publisher-2] Parsing robot urdf xml string.
[robot_state_publisher-2] Link link0 had 0 children
[robot_state_publisher-2] [INFO] [1648563777.364818033] [robot_state_publisher]: got segment link0
[robot_state_publisher-2] [INFO] [1648563777.364871376] [robot_state_publisher]: got segment world
[spawner.py-4] [INFO] [1648563777.490578558] [spawner_joint0_velocity_controller]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1648563777.498303261] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648563779.505958780] [spawner_joint0_velocity_controller]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1648563779.511958930] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648563781.523877193] [spawner_joint0_velocity_controller]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1648563781.529405524] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648563783.542295324] [spawner_joint0_velocity_controller]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1648563783.547421619] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1648563785.558941068] [spawner_joint0_velocity_controller]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1648563785.564124764] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-4] [ERROR] [1648563787.576301013] [spawner_joint0_velocity_controller]: Controller manager not available
[spawner.py-3] [ERROR] [1648563787.580096094] [spawner_joint_state_broadcaster]: Controller manager not available
[ERROR] [spawner.py-4]: process has died [pid 13368, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint0_velocity_controller -c /controller_manager --ros-args'].
[ERROR] [spawner.py-3]: process has died [pid 13363, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_state_broadcaster --controller-manager /controller_manager --ros-args'].
wilcobonestroo commented 2 years ago

We could solve it by making sure the firmware and the software had the same version. See #15

Gilocho commented 2 years ago

in the end it was on that side only that for some reason I could never get version 0.5.3v to work with the diff driver (although I generated everything from 0 without using the rosrobot code.) I had to download version 0.5.1 of both the software from odrive, as in the firmware of the card