ROS2 Control Framework unit5 ERROR

Hello, I am working through the unit5 in ros2_control framework course and have come across two issues that I cannot resolve.

  1. In the joint_trajectory_controller section the joint trajectory publisher when launched doesn’t seem to be publishing anything, the robot in gazebo stays still
    (edit) looking at the publisher topic the name of the joints seem to be those of the solo robot from section6?

  2. In the diff_drive_controller section I am getting this following error


    for the diff_drive_controller, the joint_state_broadcaster launches ok.

Can I get some help here, please?

Hello @roman.smid,

This should solve the first issue.

What is happening here is that the configuration file being used by the joint_trajectory_publisher is not the correct one. Sorry about the glitch and thanks for reporting.

Using the code editor please go to:
ros2_ws/src/ros2_control_course/common/joint_trajectory_publisher/launch

Please open the file joint_trajectory_publisher.launch.py and locate this block of code:

position_goals = PathJoinSubstitution(
    [
        FindPackageShare("joint_trajectory_publisher"),
        "config",
        "lie_down_stand_up_publisher.yaml",
    ]
)

then please replace it by this block:

position_goals = PathJoinSubstitution(
    [
        FindPackageShare("joint_trajectory_publisher"),
        "config",
        "joint_trajectory_publisher.yaml",
    ]
)

Then as usual build your ros2_ws workspace and try again.

I have updated the git repository for the course to make sure that other students do not experience the same problem.

Regards,

Roberto

Except the joint_trajectory_publisher.yaml file doesn’t exist on the bitbucket site yet. Could you add it?

Hello @roman.smid,

this should solve the second issue:

Using your code editor please cd into ~/ros2_ws/src/ros2_control_course/unit5/diffbot_sim/launch and open the file diffbot_controllers.launch.py.

Then replace this block of code:

load_diff_drive_controller = ExecuteProcess(
    cmd=['ros2', 'control', 'load_controller', '--set-state', 'start',
         'diff_drive_controller'],
    output='screen'
)

with this one:

load_diff_drive_controller = ExecuteProcess(
    cmd=['ros2', 'control', 'load_controller', '--set-state', 'start',
         'diffbot_base_controller'],
    output='screen'
)

The problem was caused by referencing a wrong controller, namely diff_drive_controller instead of diffbot_base_controller (which is the controller name defined inside the .yaml file).

Additionally, the command that you should use to move the mobile robot should be this one:

ros2 topic pub --rate 30 /diffbot_base_controller/cmd_vel_unstamped geometry_msgs/msg/Twist "linear:
 x: 0.2
 y: 0.0
 z: 0.0
angular:
 x: 0.0
 y: 0.0
 z: 1.0" -1

Thank you for bringing this to our attention!

@rzegers, thanks for putting in the effort, I will try your suggestions and let you know,

Also I noticed that unit6 doesn’t let me access the final solution, the error I am getting is

@roman.smid
Thank you for pointing that out, the link to the solution has been updated.
I apologize for the inconvenience.

Roberto

@dusevitch

Thanks for your message. As mentioned on my answer to your question about unit2, this should be solved running git pull:

Using a WebShell please cd into

~/ros2_ws/src/ros2_control_course

and run

git pull

This will download the latest changes from the remote repository.

The files inside ros2_control_course should be up to date now.

Please let me know if there are any issues,

Roberto

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.