Discussion - Ros2_Control Overview & Simulation (Making a Mobile Robot Pt 12)

Hi Josh,

Thanks for share this ros2 control video it is very helpful.
I am getting this error while running “ros2 launch my_bot launch_sim.launch.py”. If you have any suggestions to resolve this issue. kindly pleas share it with me.

[gzserver-2] [ERROR] [1669334236.428722199] [gazebo_ros2_control]: parser error Couldn’t parse params file: ‘–params-file /home/niranjan/dev_ws/install/my_bot/share/my_bot/config/my_control_params.yaml’. Error: Cannot have a value before ros__parameters at line 4, at /tmp/binarydeb/ros-foxy-rcl-yaml-param-parser-1.1.14/src/parse.c:623, at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/arguments.c:388

Thanks
Niranjan

Hi Josh,

I think I am able to resolve this issue. It looks like the my_controls.yml parameter file ros__parameters requires two underscore I had a typo here. After fixing the typo the issue got resolved.

Thanks
Niranjan

Glad you were able to get it fixed!
And yes that double underscore is an easy mistake to make, I’ve definitely tripped on that before!

1 Like

Hi I have a problem guys, after implementing ros2_control , the robot moves in the opposite direction (forward and backwards) in rviz2… Gazebo is working fine though (except for the publish_rate thingy)… please any ideas on how to solve this?

Hmm, the first thing I’d say would be to step through and make sure you understand your kinematic chain, i.e. which axes are pointing in which direction. I believe I had Z pointing out, i.e. the left wheel is “positive-Z-rotation-forwards” and the right wheel is “positive-z-rotation-backwards”.

The axis of the right wheel joint is then flipped, and you should be able to check this by not running ros2_control and instead using joint_state_publisher to manually control the joint angles. Make sure that a positive joint corresponds to the robot moving forward and vice versa.

Then in ros2_control.xacro and my_controllers.yaml (or whatever you have called them), ensure that left and right are assigned correctly.

Finally, make sure that your fixed frame is odom in RViz.

Let me know how you go!

1 Like

Hello Josh,

After implementing the fix to increase gazebo clock rate, I get the following error message when running gazebo - even though it otherwise seems to be working fine:

...
[gzserver-2] Error [parser.cc:403] Error parsing XML in file [/home/mhered/dev_ws/install/manolobot_uno/share/manolobot_uno/config/gazebo_params.yaml]: Error document empty.
...

If appears it is trying to interpret the gazebo_params.yaml file as XML and failing.

I noticed also your comment in the blog post:

On my computer I also get an error printed in the Gazebo terminal which is a bit annoying, I think the Gazebo command line parser is treating the file as an extra SDF to load and failing. We can just ignore it, but if you’ve got a fix then let me know!

Is this the error you refer to?

I got it fixed. it was the kinematic chain problem. Thank you

1 Like

So I’ve been fallowing your tutorial for a project. Thank you BTW. It’s been hard to find Raspberry Pi examples.
Problem is. I ran this part of the tutorial last night and it all seemed to work with exception of a type in my config. The robot started doing flips when set to move forward. Anyways I think I got that solved but now, today when I try to run it the controller manager is not loading… All the sudden it’s just not there any more.
Output:
ros2 run controller_manager spawner diff_cont
[INFO] [1679414845.079311127] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1679414847.090650840] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1679414849.100639643] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1679414851.114171358] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[ERROR] [1679414853.122073734] [spawner_diff_cont]: Controller manager not available

Why now? Worked last night. I can’t even list interfaces… Same problem.

Okay… Somehow controller manager mysteriously started working.
Thanks to Niranjan_Rao pointing out the underscore issue, that did make a difference.

But now he is back to doing flips instead of moving forward or reverse. I’m sure I’ll figure it out, obviously a config issue.

HI Josh,
Didn’t find any issues until Ros2_control was introduced.

With gazebo_ros2_control my robot moves only forward and backwards, doesn’t respond the angular velocity command and the /odom frame doesn’t show up in the RVIZ fixed frame selection list.

i have tried it on Foxy and humble. the result is the same.

Any ideas how I can fix this.

1 Like

Hi Josh,
Your tutorial is very helpful. and i want to use ros_control to control my robot with ackermann type instead of your diff.
You can make a video tutorial. I sincerely thank

Further into the investigation i have noticed the odom TF has the below error.

Error: TF NAN_INPUT: Ignoring transform for child_frame_id “base_link” from authority “Authority undetectable” because of a nan value in the transform (-nan -nan 0.000000) (-nan -nan -nan -nan)
at line 278 in /tmp/binarydeb/ros-foxy-tf2-0.13.14/src/buffer_core.cpp
Error: TF DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id “base_link” from authority “Authority undetectable” because of an invalid quaternion in the transform (-nan -nan -nan -nan)

@JoshNewans Can you please help me out on what causes this error and how to resolve it. This has practically stopped me in continuing further in to this wonderful tutorial.

I’m having the same problem. Everything works except the angular velocity

Hello, I have been following along and thanks for your great efforts, everything had been working fine with me until this point. When I tried the laser scan at rviz with ros2_control, the scan moves totally with the robot, the dots move with the orientation of the robot not just wiggle as the small problem but it totally moves. When I switch to gazebo_control everything comes back to normal, not sure what the problem can be?

@Alessandro_Gomez Did you find a solution to this?

I am also facing the same issue. ros2 launch articubot_one launch_sim.launch.py everything is working fine. when i launch ros2 launch articubot_one launch_robot.launch.py i am having controller_manager issues . I did not connect my joystick. and my physical robot has no response.

FYI. In ROS2 Humble, I could perfectly run with just “spawner” not “spawner.py”. It is a little change as you mentioned.

3 Likes

How did you fix the Hardware_interface issues in Humble using GitHub - joshnewans/diffdrive_arduino: A simple ROS Control Hardware Interface for differential drive control of robot whose motors are connected via an Arduino (or similar microcontroller). this Diffdrive_arduino . I was stuck here.

Hi, I facing some issue with gazebo ros2 control package. I followed the instruction for the ros2 control and launch the launch_sim.launch.py everything work perfect but could not connect with gazebo_ros2_control

The error msg:
[gzserver-2] [ERROR] [1691414356.585613673] [gazebo_ros2_control]: Error parsing URDF in gazebo_ros2_control plugin, plugin not active : text not specified in the min tag

because this I wasn’t able to connect with hardware interface

error msg:
ros2 control list_hardware_interfaces
Could not contact service /controller_manager/list_hardware_interfaces

Can you guys help me to figure out what mistake I have made.

Thank you for your help.

Hey Josh,

I am having trouble running the command ros2 run controller_manager spawner.py diff_cont
it is saying that there is no executable found. I have installed and done everything the same as you up until that point.
Any suggestions?

From
Evanston

2 Likes