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

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.

2 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

I figure it out the problem. It was my linux system i just reinstall it an now it working fine

Hello, I am driving the robot in gazebo with teleop twist keyboard but it not moving in rviz.

was working fine launching the controllers manualy but with the launcher

spawner.py-5] [INFO] [1695724540.948537156] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1695724541.043151151] [spawner_joint_broad]: Waiting for /controller_manager services
[gzclient   -3] context mismatch in svga_surface_destroy
[gzclient   -3] context mismatch in svga_surface_destroy
[spawner.py-5] [INFO] [1695724542.965812070] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1695724543.056949421] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1695724544.983464604] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1695724545.078081205] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1695724546.997859933] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1695724547.087982065] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [ERROR] [1695724549.010000553] [spawner_diff_cont]: Controller manager not available

Hi there, I am very thankful for your robot tutorial. Can you let me ask if skipping the tutorial section in video 12a will have much impact on subsequent tutorials. I don’t really need great precision

Can anyone help out with this problem . I am also facing the same issue

@JoshNewans can u help me with this
I download the entire articubot_one code from your Github and am running the command - ros2 launch articubot_one launch_sim.launch.py world:=src/articubot_one/worlds/obstacles.sdf

thabrez@thabrez-Inspiron-15-7000-Gaming:~/dev_ws2$ ros2 launch articubot_one launch_sim.launch.py world:=src/articubot_one/worlds/obstacles.sdf
[INFO] [launch]: All log files can be found below /home/thabrez/.ros/log/2023-11-21-00-51-30-748484-thabrez-Inspiron-15-7000-Gaming-7568
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): executable ‘spawner.py’ not found on the libexec directory ‘/opt/ros/iron/lib/controller_manager’

I checked many times . used source install/setup.bash , correct directory too .
I have ros iron controller manager installed
The spawner.py file also exists in location opt/ros/iron/lib/controller_manager
Have done no modification to original code
newworld.sdf
Can u help me solve this ?? please

Hi @Mohammed_Thabrez
Looks like you are using ros2 iron, this tutorial is for foxy, but it is updated to humble, see https://www.youtube.com/watch?v=qoj5_fVBPII for the update

Try the humble branches of the github repositories.

1 Like

Hi @JoshNewans

I’m currently facing some problems while working with ROS2 Foxy. I’ve followed the installation steps by executing the command:

sudo apt install ros-foxy-ros2-control ros-foxy-ros2-controllers ros-foxy-gazebo-ros2-control

However, when I attempt to launch the simulation using:

ros2 launch hoonle_bot launch_sim.launch.py world:=./src/hoonle_bot/worlds/obstacles.world

I encounter the following error:

[gzserver-2] [WARN] [1702871480.663104398] [gazebo_ros2_control]: Desired controller update period (0.0333333 s) is slower than the gazebo simulation period (0.001 s).
[gzserver-2] [INFO] [1702871480.665948117] [gazebo_ros2_control]: Loaded gazebo_ros2_control.
[gzclient -3] context mismatch in svga_surface_destroy
[gzclient -3] context mismatch in svga_surface_destroy
[gzserver-2] [INFO] [1702871590.487554188] [controller_manager]: Loading controller 'diff_cont'
[gzserver-2] [INFO] [1702871590.717861782] [controller_manager]: Setting use_sim_time=True for diff_cont to match controller manager (see ros2_control#325 for details)
[gzserver-2] [INFO] [1702871590.875489982] [controller_manager]: Configuring controller 'diff_cont'
[gzserver-2] [INFO] [1702871724.122437887] [controller_manager]: Configuring controller 'diff_cont'
[gzserver-2] [ERROR] [1702871724.122766325] [controller_manager]: Controller 'diff_cont' can not be configured from 'active' state.

Additionally, when I try to execute ros2 run control, I encounter the following error:

usage: ros2 run [-h] [--prefix PREFIX] package_name executable_name ...
ros2 run: error: the following arguments are required: executable_name, argv

Could you kindly assist me in resolving these issues?

Thank you for your help.

I FINALLY AND SUCCESSFULLY SOLVED ALL MY ISSUES AND WAS ABLE TO EXECUTE SLAM AND NAV2 ON BOTH SIMULATOR AND ALSO ON A REAL ROBOT THAT I BUILT .

I used ros Iron cause Foxy has reached its end of life (eol).
At the start of my project itself i was not able to download ros-foxy packages and i found that its dead .
check these :

  • if u are actually able to download ros-foxy packages
  • check for existence of ros2 FOXY
  • check for gazebo and its packages
  • try changing obstacles.world to a new obstacles2.sdf file ( new extension from world to sdf)
  • try running installation of controller packages command again
  • try colcon build with symlink again
  • download code directly from github rather than typing yourself

without the controller working u will get error in ros2 run control

Hello Mohammed could you list the libraries and dependencies and drivers used to get your simulated robot to work as well as the physical robot… thank you and congrats

Sorry i didnt make a record of every package i downloaded .
I completely followed the articulated bot playlist and also watched the last video in the playlist that talks about Humble changes too .

Hey man thank you so much… It took me 4 hours debugging until I read your comment. You’re genious man. Can I know how did you figured that out?

you should remove the .py from spawner.py.
Check the update video in the series (Are you ready to Humble…)