Continue Discussion 122 replies
Oct '22

Sasffm

Hi
i am getting thist error when trying to build diffdrive_arduino with colcon.

Starting >>> serial
Starting >>> serial_motor_demo_msgs
Finished <<< serial [1.69s]
Starting >>> diffdrive_arduino
Finished <<< serial_motor_demo_msgs [3.61s]
Starting >>> serial_motor_demo
--- stderr: diffdrive_arduino
CMake Error at CMakeLists.txt:16 (find_package):
  By not providing "Findhardware_interface.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "hardware_interface", but CMake did not find one.

  Could not find a package configuration file provided by
  "hardware_interface" with any of the following names:

    hardware_interfaceConfig.cmake
    hardware_interface-config.cmake

  Add the installation prefix of "hardware_interface" to CMAKE_PREFIX_PATH or
  set "hardware_interface_DIR" to a directory containing one of the above
  files.  If "hardware_interface" provides a separate development package or
  SDK, be sure it has been installed.


---
Failed   <<< diffdrive_arduino [5.06s, exited with code 1]
Aborted  <<< serial_motor_demo [3.37s]

Summary: 2 packages finished [8.30s]
  1 package failed: diffdrive_arduino
  1 package aborted: serial_motor_demo
  1 package had stderr output: diffdrive_arduino

does anyone has an idea?
Thanks

1 reply
Oct '22 ▶ Sasffm

JoshNewans

Did you install ros2_control (e.g. with sudo apt install ros-foxy-ros2-control)?
That should provide the hardware_interface dependency.

Remember that if you already installed it on your dev machine but are now building on the Pi you need to install it there too! (I forgot when I was filming haha)

Edit: meant to say there’s also another bug preventing it from building which I’m going to fix right now…

1 reply
Oct '22

Sasffm

looks like the controller manager services are not available?

1 reply
Oct '22 ▶ Sasffm

JoshNewans

So just to confirm, did you manage to build diffdrive_arduino after my last reply?

If the services are not available, that suggests the controller manager is not running - you can confirm this with ros2 node list. If it is not running, check that it’s in your launch file properly, that you are running the correct launch file, and that there are no errors in the output of the launch.

Oct '22

Sasffm

The diffdrive_arduino was succesfull build.
But i am getting errors when running “ros2 launch articubot_one launch_robot.launch.py”

[INFO] [ros2_control_node-2]: process started with pid [4577]
[INFO] [spawner.py-3]: process started with pid [4579]
[INFO] [spawner.py-4]: process started with pid [4581]
[ros2_control_node-2] [INFO] [1666217546.726356381] [DiffDriveArduino]: Configuring...
[ros2_control_node-2] terminate called after throwing an instance of 'serial::IOException'
[ros2_control_node-2]   what():  IO Exception (13): Permission denied, file /home/rosbot/robot_ws/src/serial/src/impl/unix.cc, line 151.
[spawner.py-4] [INFO] [1666217547.812861551] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1666217547.840100623] [spawner_joint_broad]: Waiting for /controller_manager services
[ERROR] [ros2_control_node-2]: process has died [pid 4577, exit code -6, cmd '/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_57dm5z2x --params-file /home/rosbot/robot_ws/install/articubot_one/share/articubot_one/config/my_controllers.yaml'].
[spawner.py-4] [INFO] [1666217549.844418248] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1666217549.872518979] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1666217551.875385029] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1666217551.904104070] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1666217553.907724653] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1666217553.938034195] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1666217555.937776050] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-3] [INFO] [1666217555.968601738] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-4] [ERROR] [1666217557.765990630] [spawner_diff_cont]: Controller manager not available
[spawner.py-3] [ERROR] [1666217557.798581779] [spawner_joint_broad]: Controller manager not available
[ERROR] [spawner.py-4]: process has died [pid 4581, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args'].
[ERROR] [spawner.py-3]: process has died [pid 4579, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args'].

Why is the controller manager not running.
I use your file from github.

1 reply
Oct '22 ▶ Sasffm

JoshNewans

Ok so if my guess is correct, this is something I knew I should probably improve in the code which is exception handling to give a more helpful error message.

I think the problem is that it goes to start up the hardware interface but it can’t see the device on the specified serial port and so it fails. A few things to check here:

* I vaguely flagged this in the video, but I should not have used /dev/ttyUSB0 as that will sometimes be the lidar, instead I should set it by the path or ID (which I will do at some point).

Let me know how you go with that or if you need further assistance :slight_smile:

Oct '22

Sasffm

Very good hints !
The problem was the ‘dialout’ group.
After adding the user to the ‘dialou’ group everything works out fine.
Thank you , that was a excellent support.
Looking forward to the next video .

1 reply
Oct '22 ▶ Sasffm

JoshNewans

Great - I’m glad we got it sorted!

Nov '22

ketill

Hello, and thanks for great tutorials. I have noticed that my robot only drives about half the linear and angular velocity as the /cmd_vel command. The counts per revolutions is way lower at 392 tics and maybe that could have something to do with the problem? Also its mentioned that the pid uses the unit tics/loop rate. Should I set that number somewhere?

1 reply
Nov '22 ▶ ketill

JoshNewans

Hmm that is strange, but we should be able to figure it out by checking each step along the way. I’m assuming through this that you are using the same Arduino code as me and the diffdrive_arduino hardware interface.

I hope that helps, please let me know how you go!

1 reply
Nov '22 ▶ JoshNewans

ketill

Thank you for your great and fast answer! And it’s amazing to get a great tutorial on the whole motor control chain. For me it was a very hard issue to solve by myself.

I will try all your suggestions. I forgot to mention that the wheel radius is indeed quite large compared with your example (0.09[m]). The wheel separation is 0.43[m]. Also the test of driving a distance and spinning in rviz2 is correct compared to the real robot. (One meter in rviz is one meter on the robot and 360 deg is 360 deg on the robot). I am currently using the full navigation stack so the problem could be higher up but the issue of wrong speed remains when driving with a controller so the issue should not be there (checked agains /cmd_vel message).

Don’t know where to post this but I found an issue using the Velodyne 16 lidar to laser scan (2D lidar) in Slam toolbox node. It is a quite common lidar so maybe some other have the same issue. It took a long time for me to find the bug but apparently when converting the pointcloud message to laserscan message with the official driver the lidar can give the error of too many or too few scans per revolution. I think if the resolution in the .yaml file is not evenly divided it cases the error and then the slam toolbox is not able to start correctly. I did a bad fix of changing the resolution: 0.006 and it works.

Hope it can be to any help and thanks again. Will update when i have found the issue :slight_smile:

Dec '22

Douglas_Beach

Hello! I wanted to thank you for these amazing tutorials and ask for some guidance on a problem I just ran into. While trying to build diffdrive_arduino, I received the following error:

doug@doug-desktop:~/ros2_ws$ colcon build --symlink-install
Starting >>> serial
Starting >>> arduino_com
Starting >>> my_bot
Starting >>> my_robot_controller
Finished <<< my_bot [3.89s]
Starting >>> robot_controller
Finished <<< serial [4.15s]
Starting >>> diffdrive_arduino
--- stderr: diffdrive_arduino
In file included from /home/doug/ros2_ws/src/diffdrive_arduino/src/diffdrive_arduino.cpp:1:
/home/doug/ros2_ws/src/diffdrive_arduino/include/diffdrive_arduino/diffdrive_arduino.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
    7 | #include "hardware_interface/base_interface.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/diffdrive_arduino.dir/build.make:76: CMakeFiles/diffdrive_arduino.dir/src/diffdrive_arduino.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/diffdrive_arduino.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
In file included from /home/doug/ros2_ws/src/diffdrive_arduino/src/fake_robot.cpp:1:
/home/doug/ros2_ws/src/diffdrive_arduino/include/diffdrive_arduino/fake_robot.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
    7 | #include "hardware_interface/base_interface.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/fake_robot.dir/build.make:76: CMakeFiles/fake_robot.dir/src/fake_robot.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/fake_robot.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< diffdrive_arduino [5.76s, exited with code 2]
Aborted  <<< my_robot_controller [10.0s]
Aborted  <<< arduino_com [10.6s]
Aborted  <<< robot_controller [8.27s]

Summary: 2 packages finished [13.3s]
  1 package failed: diffdrive_arduino
  3 packages aborted: arduino_com my_robot_controller robot_controller
  1 package had stderr output: diffdrive_arduino

I think I figured out the problem… I am running ROS Humble and the Ros2_control package for humble doesn’t have hardware_interface/base_interface.hpp anymore. https://github.com/ros-controls/ros2_control/tree/humble/hardware_interface/include/hardware_interface

I wanted to check and see if there may be a workaround by editing the diffdrive_arduino.h file to not use base_interface? Any guidance would be greatly appreciated, thanks!

3 replies
Dec '22

BigShark3000

I am using Humble and my HW Plugin is based on the ros2_control_demos I found that I had to swap “position” and “velocity” name for the state_interfac, in the command_interface, in the ros2_control.xacro file. As the plugin was expecting Position first.
This now works for me.

    <ros2_control name="RealRobot" type="system">
        <hardware>
            <plugin>hover_diffdrive/HoverDiffDrive</plugin>
        </hardware>
        <joint name="left_wheel_joint">
            <command_interface name="velocity">
                <param name="min">-10</param>
                <param name="max">10</param>
            </command_interface>
            <state_interface name="position"/>            
            <state_interface name="velocity"/>
        </joint>
        <joint name="right_wheel_joint">
            <command_interface name="velocity">
                <param name="min">-10</param>
                <param name="max">10</param>
            </command_interface>
            <state_interface name="position"/>
            <state_interface name="velocity"/>
        </joint>
    </ros2_control>
Dec '22 ▶ Douglas_Beach

JoshNewans

Hey! This is an issue I’m well aware of (just this week someone flagged it on GitHub too), but have not put any energy into resolving yet.

As I understand it the fix is a bit more involved than just the dependence on that file, and that it was a more substantial change to the API.

My current plan is that at the end of the build series (which is drawing near!) I will do a video specifically on how to write a hardware interface for humble, and as a demo I will take my foxy one and upgrade it.

In the meantime I’m not sure if anyone else has forked /updated it (I think someone might have but
I can’t remember). If I do find out I’ll post here. As @BigShark3000 helpfully noted, you could have a go at porting it yourself using the ros2_control_demos - if you do then let us know! That’s also a helpful note about the requirement to swap the interface order.

1 reply
Dec '22 ▶ JoshNewans

Douglas_Beach

Thanks for the responses BigShark3000 and Josh. I figured it wasn’t going to be a simple fix but thought I would ask to be sure! I’ve been looking through the ros2_control_demos and diffdrive_arduino code to try and understand how it all works… definitely have a ways to go there. If I do manage to get something working, I’ll be sure to share.

1 reply
Jan '23

teknetik

This fork seems to work. It compiles I have not actually tested it as such but hopeful:

Jan '23

Sudhanshu_ranjan

I am getting this error.

ubuntu@ubuntu:~/robot_ws$ colcon build --symlink-install
Starting >>> serial_motor_demo_msgs
— stderr: serial_motor_demo_msgs
CMake Error at CMakeLists.txt:19 (find_package):
By not providing “Findament_cmake.cmake” in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
“ament_cmake”, but CMake did not find one.

Could not find a package configuration file provided by “ament_cmake” with
any of the following names:

ament_cmakeConfig.cmake
ament_cmake-config.cmake

Add the installation prefix of “ament_cmake” to CMAKE_PREFIX_PATH or set
“ament_cmake_DIR” to a directory containing one of the above files. If
“ament_cmake” provides a separate development package or SDK, be sure it
has been installed.


Failed <<< serial_motor_demo_msgs [0.38s, exited with code 1]

Summary: 0 packages finished [0.87s]
1 package failed: serial_motor_demo_msgs
1 package had stderr output: serial_motor_demo_msgs
1 package not processed
ubuntu@ubuntu:~/robot_ws$

1 reply
Jan '23 ▶ Sudhanshu_ranjan

JoshNewans

Did you source your ROS installation first? (i.e. source /opt/ros/foxy/setup.bash)?

1 reply
Jan '23 ▶ JoshNewans

Sudhanshu_ranjan

Yes now it work the problem was same that you have mentioned. Thank you

Feb '23

Enno_Stelma

Hi Josh, Thanks for a great series. I got pretty much stuck on getting it all to work on a real robot. I’m running Humble on Ubuntu 22.04. Since ROS-Serial has been replaced by MicroRos I went that route.

Here’s my setup:
Ubuntu 22.04 on a virtual machine (some issues along the way as you mentioned but all sorted)
Completed diff drive robot with RPi4 (Ubuntu 22.04), Arduino Due (MicroRos), L298N motor driver.

I can control the robot with Twist messages and I can publish odometry from the Arduino. The problem is getting it to work with ros2_control and specifically implementing a hardware interface.

The way I understand it is that diffdrive_arduino won’t work in this scenario because it relies on ROS-Serial. I did try to use ros2_control_demos to solve the problem but did not succeed.

So my question is:
Can diffdrive_arduino work in this setup?
If so, how do I get that to work?
If diffdrive_arduino can’t work, what are my options?

The MicroRos and ros2_control combo seems pretty new and I can find very little about it. I’ve been working on this for a few weeks now but I’m not getting any further.

1 reply
Feb '23 ▶ Enno_Stelma

JoshNewans

Yeah so the confusion here (and it’s not just you, others have had the same issue) is that diffdrive_arduino does NOT use rosserial (or micro-ROS for that matter).

rosserial is a method for sending ROS messages over a serial line (to an Arduino or similar). And now with micro-ROS those kinds of problems can be solved differently.

Whereas diffdrive_arduino isn’t sending ROS messages at all, it is making a pure serial connection to software on the other end, speaking a (very simple) custom protocol. So you shouldn’t have rosserial or micro-ROS running on the Arduino, it doesn’t know anything about ROS, just some simple motor control serial commands. diffdrive_arduino is doing all the translation from ROS to serial.

If you really want to use micro-ROS on the Arduino, it probably makes sense to skip ros2_control completely. And that is a perfectly acceptable setup - just not what I’ve done in my tutorials. In that case you’ll probably want to have the Arduino receiving a Twist and handling all the diff-drive calculations (which it seems you are doing), rather than implenting it on the ROS side.

I hope that clears things up, if not please ask further questions!

Feb '23

Enno_Stelma

Thanks for the super quick reply Josh, that clears it all up. I’m going to stick with your route so that I can follow your track in coming videos. I’m going back to the motor control video to implement RosArduinoBridge and then implement diffdrive_arduino. Plenty of time to play around with MicroRos etc later.

Feb '23

Jon_Peroutka

Hi, I’m having a problem getting my pi to locate the ros2 control package using ‘sudo apt install’. It just cannot find it. I’ve updated and upgraded, following the instructions here: Ubuntu (binary) — ROS 2 Documentation: Humble documentation

Any idea what’s going wrong? I’m surprised I can’t get the system to locate it. Is there a workaround? Thanks for any help!

1 reply
Feb '23

sampath_ganesh

@JoshNewans sir . I was able to run the robot in real time but unable to run in the rviz i.e the robot was not moving in the rviz
I have tried to change frames but no result , is there any solution I was using ros2 humble and 22.04

Mar '23 ▶ Jon_Peroutka

JoshNewans

Hey Jon, this should be fixed with the latest humble update, so if you try an apt update and then go again hopefully it will be there. Let me know if you have further troubles.

Mar '23

Praveen_Kumar

Hi,

Thanks for the great tutorial. I followed everything correctly till Ros2 Controller. My setup is a 4 wheel robot instead of 2 wheels. I have used differential drive and setup wheel count as 2. Everything worked perfectly until I added diffdrive_arduino package. I have modified the package to take in four wheels as input. However the issues are:

  1. When I try driving, all the wheels are reversed. I modified the diffdrive package to take inverted inputs (- for all vel1, vel2, vel3 and vel4). This seems to fix and motors driving correctly
  2. Teleop twist keyboard can be used to control the robot only if linear and angular velocity is set to 0.4xxx. Anything more than 5 or less than 3 does not move the wheels at all.
  3. Not all motors rotate at the same speed.

So, my questions are:

  1. Can I use the previous serial_motor_demo library to complete SLAM setup?
  2. Any ideas why the robot is not responding to twist correctly?
1 reply
Mar '23

JoshNewans

Hi Praveen!

There are a bunch of places that wheel reversing can occur, depending on your hardware. Getting the wrong pins on the driver in, the driver out, the controller, the wrong axis direction in URDF, etc. It sounds like what you’ve done there is probably not the “correct” solution, but if it works, it works :slight_smile:

That’s very odd. To start with diagnosing I’ll need more detail on your motors/controllers/drivers etc. (which might also help us with problem 1). Depending on how things are being mapped it’s not unusual for there to be a lower limit that it won’t turn below, but an upper limit is strange.

This is unfortunate, but not too surprising. Again, we’ll need more details on how you have things hooked up but this is where the PID controller comes into play (which if you’re following the tutorials will be external to ROS/Pi stuff, in an Arduino or some other dedicated controller). The quality control of the motors will be a factor, but the PID controller should be able to be tuned to get the motors performing fairly similarly. If you don’t have a PID controller and are running in open loop, that might also be the cause of problem 2.

Sort of. You could modify it to accept a Twist and have differential drive control, but you’d be better off fixing the other issues instead and things should just work.

Yeah, by the sound of things it’s worth stepping through the details of your setup and making sure the low-level motor control is working before touching the ROS-level stuff. If it’s broken then no amount of ROS tweaking will fix things!

So please post some more details about your hardware and how it’s wired up (you can upload pictures to imgur and embed them here) and we’ll see what we can figure out :slight_smile:

Mar '23

tiptonnet

[INFO] [launch]: All log files can be found below /home/system/.ros/log/2023-03-21-14-56-32-932971-mapperbot-5148
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: name ‘Command’ is not defined

Is there an import I’m missing?

Mar '23

tiptonnet

There most certainly was :slight_smile:
from launch.substitutions import Command

Mar '23

LeoCleaner

Hi Josh,

Is it possible to set a parameter for defining the Serial Port of arduino in the launch file. I can scan the ports automatically and say on which port is my Lidar and on which is the Arduino Motor Control but I do not know how to set it dynamically in the diffdrive_arduino.

Thank you very much!

Cheers,
Ivo

May '23

LeoCleaner

Hi,

I have lidar and arduino motor control on srial ports of my robot (on usbs of my raspberry pi). Sometimes lidar and arduino changes serial ports (lidar is on 1 instead of 0 and arduino on 0 instead of 1)and i have to change the configuration of both of them and recompile and start again. Is there an way to make it automatically on the start.

Thank you very much!

Best regards,
Ivo

1 reply
May '23

jaronski

Hi Josh, do you know if it is possible to implement a real controller of a robot (reality) and in parallel a Gazebo simulation so that ros2_control controls both the hardware and the behavior in Gazebo like a digital twin? In your article i understood that its either the real robot or gazebo simulation.

1 reply
May '23

Betul_Duran

Hello
All the hardware and software I use are the same as the one you use. The router is the same. When I connect the router to the development machine with ethernet as you do, and when I connect it to the raspberry pi 4, when I want to control the robot as in the 13th video, it gives a biiiip sound and cuts the internet for a short time. It gives buffer.cpp error, where could I have made a mistake?

1 reply
May '23 ▶ LeoCleaner

JoshNewans

Hi Ivo, sorry for not getting back to you (and many other people).

The simplest way to achieve what you want is instead of referencing the devices as /dev/ttyUSB0 or whatever, instead use /dev/serial/by-id/xxx or /dev/serial/by-path/xxx. These paths are tied to either the identifier of the hardware, or the actual USB port it is plugged into, so as long as you keep them in the same ports, the OS should identify them by the same path each time!

If you really want to have it in the launch file you can use an xacro argument and pass it in, similar to how we handle the sim mode and ros2_control mode in rsp.launch.py.

Again, sorry it’s late but I hope that helps!

May '23 ▶ jaronski

JoshNewans

That’s a great question and I’ve never really thought about it!
In short, I think the answer is no…but sort of yes?
The ros2_control controller expects to only control one hardware interface, so to achieve what you’re talking about you’d just have to run two independent controllers and have them both listening to the same twist topic (but avoid them publishing to the same feedback).

You could achieve a similar result if you bypassed ros2_control completely and wrote a custom node that interacted with Gazebo and also your robot but it gets…messy (and I suspect probably won’t achieve the desired result, especially with something like a mobile robot. It might be good for an arm)

May '23 ▶ Betul_Duran

JoshNewans

Wow that is a strange issue, I’m not sure, sorry.
Also I haven’t mentioned this but I actually swapped to a different router as I thought the first one was maybe causing me problems…but then I still had problems with the new one too so I never said anything.

When you say it beeps, do you mean the router beeps or the Pi beeps? Perhaps it is a power issue? How are you powering the router?

May '23

Ahmed_Tarek

Hi Josh, thanks a lot for your tutorials,

I am using Arduino UNO instead of Nano, there is no issues when I do launch launch_robot file and it tells me that all controllers configured correctly but when I try to drive it with teleop, none of the motors move!!.. my driver EN pins on the UNO are 6,3,9,5.

Please help me, my graduation project is depending on that

Jun '23

Afiq003

Hi Josh, thanks for this great tutorial. However I’m facing issue when unbreaking gazebo. I follow your tutorial exactly, but when i launch my launch_sim.launch.py, i get this error instead

afiq@afiq-VM:~/dev_ws$ ros2 launch my_bot launch_sim.launch.py world:=src/my_bot/worlds/obstacles.world
[INFO] [launch]: All log files can be found below /home/afiq/.ros/log/2023-06-02-08-25-17-400678-afiq-VM-24746
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=SubstitutionFailure('executed command failed. Command: xacro /home/afiq/dev_ws/install/my_bot/share/my_bot/description/robot.urdf.xacro use_ros2_control:=true sim_mode:=true')>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 3 more times]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 444, in execute
    self._perform_substitutions(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 399, in _perform_substitutions
    evaluated_parameters = evaluate_parameters(context, self.__parameters)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 164, in evaluate_parameters
    output_params.append(evaluate_parameter_dict(context, param))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 71, in evaluate_parameter_dict
    evaluated_value = perform_substitutions(context, list(value))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py", line 232, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/substitutions/command.py", line 116, in perform
    raise SubstitutionFailure(f'executed command failed. Command: {command_str}')
launch.substitutions.substitution_failure.SubstitutionFailure: executed command failed. Command: xacro /home/afiq/dev_ws/install/my_bot/share/my_bot/description/robot.urdf.xacro use_ros2_control:=true sim_mode:=true

How do i solve this?

2 replies
Jun '23 ▶ Afiq003

Afiq003

Solved this. Figure out don’t need to install gazebo ros2 control package

1 reply
Jun '23 ▶ Afiq003

JoshNewans

I’m glad you got it sorted but I’m a bit confused by your solution.

It seems like xacro itself was failing - possibly you had an error in your URDF?

Jun '23

AddyPete

Hello I’m a beginner in robotics, im mainly a software guy. With that said, i have a question.

  1. is it possible that ill just make my own hard code controller instead of using diff drive from ros2 control package? Ill just convert the cmd_vel to left and right motor velocity.
  2. by doing the mentioned above, what are the disadvantages of this? I’m doing this because i don’t know how to get the hardware interfaces of the physical robot, i only know how to send commands which are the left and right motor velocities.
1 reply
Jun '23

JoshNewans

Welcome!

Yep

The disadvantages are:

When you say

What do you mean? Essentially all a ros2_control harware interface is is a C++ plugin that does that, but takes the input from ros2_control rather than your own calculation.

But yeah, doing it the long way is always an option (and not a bad one for learning how differential drive control works) but at some point it makes sense to take the more robust, flexible option of ros2_control.

(P.S. I’ve responded to your other message)

1 reply
Jun '23 ▶ JoshNewans

AddyPete

What i mean with i can send only motor commands. Is that by using pyserial and ESP32 in my laptop, i’ll just write a certain string that indicated the speed value of both motors for example, the string is “0.5,1.0&\n” (0.5 = left motor speed, 1.0 = right motor speed) then i use arduino.write() to send those command sending it to another ESP32 that has arduino attached to it.

I did this because the hardware guy just told me to send those string via esp32, and he just do the rest of the hardware control thing.

We don’t use rasberry pi btw, just like you did.
So it’s basically i’m sending a string command with my laptop connected to esp32 then another esp32 connected to arduino just received the command, and i don’t know how the hardware guy works around with that string i have sent. I can ask him if necessary to provide more information.

Is our approach in doing this project correct? Is there anyway i can expose state interfaces with robot with our current approach? Thanks

1 reply
Jun '23

Jeffrey_Jene

I have a sort of weird problem. I’ve resumed this project after a couple of months and actually started it over as I’d forgotten a bit. The serial motor demo and gui works great on my setup, the motors behave as expected. However, after completing the ros2 control files and code, using teleop causes the motors to go crazy. They will start slowly in the same direction, then they will quickly climb to FULL speed of my motors, one flipping direction in the process and the robot would spin in place at full speed (I have it on blocks so this won’t happen). Nothing I’ve messed with seems to have made any difference. It almost reminds me of an uncontrolled PID controller, like the motors are trying to match a value or catch up with something and max out. Does anyone have any ideas?

1 reply
Jun '23 ▶ AddyPete

JoshNewans

Honestly, that sounds very similar to how mine works, just with a few extra steps - which means it shouldn’t be too hard to modify!
I recommend watching my motor tutorial first, so that you understand how mine is structured (and how it is similar and different to yours).

Then watch the hardware interface tutorial which shows how to connect that to ros2_control. You should be able to pretty much take my hardware interface and make some small modifications to the class that handles the comms.

Jun '23 ▶ Jeffrey_Jene

JoshNewans

Bizarre! Yeah it does sound like a PID controller behaving badly.
One possible issue if you are using my exact code is that the PID settings might have changed since the earlier version? The latest hardware interface is here and it gives you the ability to tweak the PID parameters.
That version SHOULD leave them as default if you don’t set them, but I think there were other versions with a hardcoded value so you may have that?

My other suggestion would be to add print statements into the hardware interface to confirm exactly what is being sent to the motors. That’s a little tedious but should get to the bottom of it.

Jun '23

Jeffrey_Jene

It looks like that branch is for Humble. I’m using Foxy, can it be used with it or do I need to upgrade?

1 reply
Jun '23

Adi

Hey @JoshNewans thank you for the great tutorial, it has been of great benefit to us as students. We are having difficulty loading the /controller_manager services, we’ve tried the solutions you suggested earlier in the thread to @Sasffm, but it is still not working. We have the same setup, and the device port has been set correctly, even the user has been added to the dialout group. The following is the error obtained on running the launch file.

[INFO] [launch]: All log files can be found below /home/vahin/.ros/log/2023-06-07-09-52-16-628234-ubuntu-13541
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [13544]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link chassis had 2 children
[robot_state_publisher-1] Link caster_wheel had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] [INFO] [1686131537.466259297] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1686131537.466644027] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1686131537.466723784] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1686131537.466753468] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1686131537.466781004] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1686131537.466809170] [robot_state_publisher]: got segment right_wheel
[INFO] [ros2_control_node-2]: process started with pid [13606]
[INFO] [spawner.py-3]: process started with pid [13608]
[INFO] [spawner.py-4]: process started with pid [13610]
[ros2_control_node-2] [INFO] [1686131543.680967466] [DiffDriveArduino]: Configuring...
[ros2_control_node-2] [INFO] [1686131543.687668416] [DiffDriveArduino]: Finished Configuration
[ros2_control_node-2] [INFO] [1686131543.688505651] [DiffDriveArduino]: Starting Controller...
[ros2_control_node-2] [INFO] [1686131545.719892550] [controller_manager]: update rate is 30 Hz
[ros2_control_node-2] [INFO] [1686131545.762545973] [controller_manager]: Loading controller 'diff_cont'
[ros2_control_node-2] [ERROR] [1686131545.762714005] [controller_manager]: Loader for controller 'diff_cont' not found.
[ros2_control_node-2] [INFO] [1686131545.762758207] [controller_manager]: Available classes:
[ros2_control_node-2] [INFO] [1686131545.762797873] [controller_manager]:   controller_manager/test_controller
[ros2_control_node-2] [INFO] [1686131545.762828928] [controller_manager]:   controller_manager/test_controller_failed_init
[ros2_control_node-2] [INFO] [1686131545.762866667] [controller_manager]:   controller_manager/test_controller_with_interfaces
[ros2_control_node-2] [INFO] [1686131545.835433835] [controller_manager]: Loading controller 'joint_broad'
[ros2_control_node-2] [ERROR] [1686131545.835685402] [controller_manager]: Loader for controller 'joint_broad' not found.
[ros2_control_node-2] [INFO] [1686131545.835744493] [controller_manager]: Available classes:
[ros2_control_node-2] [INFO] [1686131545.835786603] [controller_manager]:   controller_manager/test_controller
[ros2_control_node-2] [INFO] [1686131545.835817731] [controller_manager]:   controller_manager/test_controller_failed_init
[ros2_control_node-2] [INFO] [1686131545.835846286] [controller_manager]:   controller_manager/test_controller_with_interfaces
[ERROR] [spawner.py-4]: process has died [pid 13610, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args'].
[ERROR] [spawner.py-3]: process has died [pid 13608, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args'].

Is there something we’ve missed out on? The controller_manager had issues earlier as well when running on the dev machine but it was sorted when it was rerun a few times.

1 reply
Jun '23 ▶ Adi

JoshNewans

Ok so the main error here is that it goes to load diff_cont and joint_broad but can’t find them. Instead it is finding one called test_controller (I’m not sure if you’ve put that in or if it’s standard?)

Do you have a controllers.yaml file that you are passing in? What is inside it? You should have the diff drive controller and joint state broadcaster defined in there.

If that is set up correctly, then make sure it is actually being loaded!

1 reply
Jun '23 ▶ Jeffrey_Jene

JoshNewans

Yeah the old branch is foxy but I’m not really maintaining it.
The principles are all pretty similar so if you compare the two and watch this video you should be able to figure it out.

1 reply
Jun '23 ▶ JoshNewans

Adi

Thank you for your prompt response and suggestions, we will look into it.

Jun '23

FrankfurtDynamics

I have a really weird Issue. The robot drives forwards and backwards fine but it doesn’t turn.

1 reply
Jun '23 ▶ FrankfurtDynamics

JoshNewans

Hmm that is odd.

Is this with teleoperation or autonomous control?

I’d first use ros2 topic echo to check the contents of your cmd_vel topic are correct and you are sending a Z rotation.

If that is all ok then check your diff drive parameters (wheel spacing etc) are all correct and you don’t have anything odd in there like rotational limits.

Jun '23

FrankfurtDynamics

Both it is even a problem when I just use the ROS-Arduino-Bridge.ino and miniterm. When I type o 255 255 or negative it works fine. When I type o 255 -255 the motors don’t turn at all.

1 reply
Jun '23 ▶ JoshNewans

Jeffrey_Jene

After fooling around with it quite a bit, I do see that it is the PID values, possible something else as well. I could sit and fool with the values, but the behavior is still strange (the motors start slow and rev up to the required speed, but overshoot it and reverse directions). Open loop control works great. I would love to rewrite this thing at some point. I’m fuzzy on a few things I need to research first, like how to translate input tick count to speed to PWM. I’m also not sure what “Ko” is in the PID code. Josh, what are the RPM speeds of your motors? I think mine are about 250 or so, maybe too much for this application (if that even makes a difference). Anyway, I’ll keep fussing with it.

2 replies
Jun '23

Cliff_Andrew_Oliver

[INFO] [launch]: All log files can be found below /home/cliff/.ros/log/2023-06-11-09-19-26-129315-cliff-Legion-4342
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=PackageNotFoundError("package 'twist_mux' not found, searching: ['/home/cliff/dev_ws/install/serial_motor_demo', '/home/cliff/dev_ws/install/serial_motor_demo_msgs', '/home/cliff/dev_ws/install/diffdrive_arduino', '/home/cliff/dev_ws/install/serial', '/home/cliff/dev_ws/install/articubot_one', '/opt/ros/foxy']")>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/packages.py", line 50, in get_package_prefix
    content, package_prefix = get_resource('packages', package_name)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/resources.py", line 48, in get_resource
    raise LookupError(
LookupError: Could not find the resource 'twist_mux' of type 'packages'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 453, in execute
    ret = super().execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 823, in execute
    self.__expand_substitutions(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 668, in __expand_substitutions
    cmd = [perform_substitutions(context, x) for x in self.__cmd]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 668, in <listcomp>
    cmd = [perform_substitutions(context, x) for x in self.__cmd]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py", line 232, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/executable_in_package.py", line 76, in perform
    package_prefix = super().perform(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/find_package.py", line 79, in perform
    result = self.find(package)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/find_package.py", line 96, in find
    return get_package_prefix(package_name)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/packages.py", line 52, in get_package_prefix
    raise PackageNotFoundError(
ament_index_python.packages.PackageNotFoundError: "package 'twist_mux' not found, searching: ['/home/cliff/dev_ws/install/serial_motor_demo', '/home/cliff/dev_ws/install/serial_motor_demo_msgs', '/home/cliff/dev_ws/install/diffdrive_arduino', '/home/cliff/dev_ws/install/serial', '/home/cliff/dev_ws/install/articubot_one', '/opt/ros/foxy']"
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=RuntimeError('Signal event received before subprocess transport available.')>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/opaque_function.py", line 75, in execute
    return self.__function(context, *self.__args, **self.__kwargs)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 443, in __on_signal_process_event
    raise RuntimeError('Signal event received before subprocess transport available.')
RuntimeError: Signal event received before subprocess transport available.
[INFO] [robot_state_publisher-1]: process started with pid [4345]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link base_footprint had 0 children
[robot_state_publisher-1] Link chassis had 4 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link caster_wheel had 0 children
[robot_state_publisher-1] Link face_link had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] [INFO] [1686455366.472416353] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1686455366.472564150] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1686455366.472588526] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1686455366.472606757] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1686455366.472624637] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1686455366.472642309] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1686455366.472659212] [robot_state_publisher]: got segment face_link
[robot_state_publisher-1] [INFO] [1686455366.472675486] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1686455366.472692599] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1686455366.472709362] [robot_state_publisher]: got segment right_wheel
[ERROR] [robot_state_publisher-1]: process[robot_state_publisher-1] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [robot_state_publisher-1]: sending signal 'SIGTERM' to process[robot_state_publisher-1]
[ERROR] [robot_state_publisher-1]: process has died [pid 4345, exit code -15, cmd '/opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher --ros-args --params-file /tmp/launch_params_zw350_hn'].

Cant find whats actually going wrong, feels like its ros not building properly

1 reply
Jun '23 ▶ FrankfurtDynamics

JoshNewans

Very odd, I’m suspicious of maybe a wiring issue with the motors/driver/arduino?

Do

1 reply
Jun '23

JoshNewans

Interesting, I have had similar problems with other motors. I still got them to work but they were a bit more sensitive to the PID settings.

Yeah me too. I didn’t write the Arduino code (just made some small mods) and would like to do it from scratch.

I also found this confusing. I believe this and also the reason everything is done in “encoder ticks per loop” is to avoid doing floating point arithmetic in the Arduino. So the Ko just scales things up. E.g. if we want Kp = 0.5 (and Ko = 1) we can’t do that, so instead we set Kp = 5 and Ko = 10.
It’s a little while since I dug into it though so that might be not quite right.

Pretty sure they are 110RPM. 250 is pretty fast, especially if your encoders aren’t super fast. E.g. your requests might boil down to the difference between a few integers in counts per loop and the PID will be jumping rapidly between them.

2 replies
Jun '23 ▶ Cliff_Andrew_Oliver

JoshNewans

Make sure when posting code blocks (I have edited yours) you put backticks (the ~ key without shift) around it to make it easier to read, like this:

```
My code here
```

Your issue here is you don’t have twist_mux installed (sudo apt install ros-foxy-twist-mux).

This error should be clearer, except I have not explicitly made twist_mux a dependency of articubot_one so it tries to run without checking that it exists, and you get that very messy error.

Jun '23 ▶ JoshNewans

FrankfurtDynamics

I found the problem it seems to be some internal problem with the Arduino uno, it works fine on the nano.

Jun '23 ▶ JoshNewans

Jeffrey_Jene

I think I will take a stab at writing new Arduino code. Josh, if you were personally to do this would you continue using Serial or would you go for something like MicroROS (keeping in mind one could no longer use the Nano if that were the case)? I use the Teensy quite a bit so perhaps I’ll try something for both (I’d like to learn MicroROS myself). This is out of scope so I’ll start a new topic for discussion later.

Jun '23 ▶ JoshNewans

Jeffrey_Jene

Hey Josh, wanted to let you know I purchased a couple of 100RPM motors and that seemed to do the trick. Everything is now running smoothly. Those other motors were probably just too fast for the PID/encoders to handle.

BTW, is it possible to get permissions to create new topics? It doesn’t look like I have (unless I’m not supposed to).

1 reply
Jun '23 ▶ Jeffrey_Jene

JoshNewans

Nice, I’m very glad that sorted it (it’s always disappointing when you sink money into extra hardware and it doesn’t help!)

Yeah, creating new topics is restricted to paid members over at Patreon however I have tried to make the bottom tier very affordable. This also gets you access to the Discord server and helps support the channel.

I haven’t got Patreon and Discourse synced up yet though and have to update user permissions manually, so don’t be afraid to remind me if needed :slight_smile:

1 reply
Jun '23 ▶ JoshNewans

Jeffrey_Jene

Sounds fair. :slight_smile: I have now joined Patreon.

Jul '23

Jeffrey_Jene

Maybe the answer to this is in my face and I don’t see it, but I’m going to ask anyway. I’ve created a launch file for the physical robot after success with all the simulations. It runs and teleoperates just fine. When I open RVIZ, however, I noticed that the model’s wheels are screwed up because the wheel transforms can’t be resolved (we used to cheat and run joint_state_publisher_gui to resolve this). This does not happen when running RVIZ with the Gazebo simulation. Is this behavior correct? Is there something I can do (besides running the JSP gui) to fix this issue?

Edit: I figured it out. I had the wheels parented to the base_link. When I changed the parent to the chassis the joints are now recognized. I’m leaving this post for anyone who might have the same issue with their design.

1 reply
Jul '23

Devbot

Im having issues where my Twist msgs from teleop is having the following problems:
-not updating my robot position correctly
-unstable, moves slow sometimes and very fast other times
-when moving straight, it never updates the position except for a fixed 0.1 meter even if i keep going straight for more.
-after a few turns, it gets stuck and i cant use teleop anymore until i manually nudge the wheel.

note: the updates and revolutions are exact when im turning the wheels using my hands. the problems start when i use teleop.

and i am also confused about where to change my PID values because there are ones in the diffdrive_arduino.cpp (arduino_.setPidValues(30,20,0,100)) and ones in the arduino file, which ones should i be changing?

All the code works up until the gazebo simulation and mapping.

im using ros humble and have updates my files appropriately using your most recent video.

Any help as to where to start fixing the issue would be very very appreciateddd

FIXED!! = The issue was very very lame, even though i spent days changing the code assuming its the cause. The issue was wiring and power! the encoders and logic were getting the power from the controller because i forgot to provide it power and ground it from and to the arduino, and it caused it to keep shutting off and on and acting crazy.

1 reply
Jul '23 ▶ Jeffrey_Jene

JoshNewans

Glad you got it sorted.
I was going to suggest checking that you were running the joint_state_broadcaster which is responsible for publishing the joint states when using ros2_control, which are then read by robot_state_publisher to broadcast the transforms. Including that as a note in case someone has a similar (but different!) issue to what you did :slight_smile:

Jul '23 ▶ Devbot

JoshNewans

Ahh yep those kiind of wiring issues can be a real pain and cause very sporadic behaviour (or kill your encoders as some people have found :frowning: ) I’m glad it’s fixed for you though.

Re the PID values, from memory on the Foxy version you should change the hardcoded values in the cpp, and on Humble you can set them as a parameter. If you change them on the Arduino I think that will be changing the default value which is the case if diffdrive_arduino never sends an override.

(I think that’s all correct, I haven’t looked at it for a little while)

Aug '23

Linh_Nguy_n_D_ng

Hi @JoshNewans
i installed RO2 Humble. I am getting this error when trying to build diffdrive_arduino with colcon build. Can you help me?

Starting >>> serial
Starting >>> articubot_one
Finished <<< articubot_one [0.88s]
Finished <<< serial [1.39s]
Starting >>> diffdrive_arduino
— stderr: diffdrive_arduino
In file included from /home/robot/rasp_ws/src/diffdrive_arduino/src/fake_robot.cpp:1:
/home/robot/rasp_ws/src/diffdrive_arduino/include/diffdrive_arduino/fake_robot.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
7 | #include “hardware_interface/base_interface.hpp”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/fake_robot.dir/build.make:76: CMakeFiles/fake_robot.dir/src/fake_robot.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/fake_robot.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs…
In file included from /home/robot/rasp_ws/src/diffdrive_arduino/src/diffdrive_arduino.cpp:1:
/home/robot/rasp_ws/src/diffdrive_arduino/include/diffdrive_arduino/diffdrive_arduino.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
7 | #include “hardware_interface/base_interface.hpp”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/diffdrive_arduino.dir/build.make:76: CMakeFiles/diffdrive_arduino.dir/src/diffdrive_arduino.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs…
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/diffdrive_arduino.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Failed <<< diffdrive_arduino [23.8s, exited with code 2]

Summary: 2 packages finished [26.4s]
1 package failed: diffdrive_arduino
1 package had stderr output: diffdrive_arduino

1 reply
Aug '23 ▶ Linh_Nguy_n_D_ng

Linh_Nguy_n_D_ng

@JoshNewans . I installed diffdrive_arduino of GitHub - Buzzology/diffdrive_arduino: A simple ROS Control Hardware Interface for differential drive control of robot whose motors are connected via an Arduino (or similar microcontroller).. I can run teleop_twist_keyboard to drive my around. My motors can work. But when I open rviz2 for tracking, when I press some letters ‘i’ and ‘m’ on the keyboard, the robot runs circle around base_link , doesn’t go straight ( forward and backward). I installed ROS2 HUMBLE. Can you help me, plz?

Sep '23

Shai_Mizrachi

I’m a bit confuse
When using SIM mode
The file ros2_control.xacro define the differential wheel plug in for gazebo through the yaml files
the file gazebo_control.xacro define diff_drive plugin

isn’t redundant? what do I miss with my understanding?

Sep '23

mamba0206

@JoshNewans Hi! Firstly, amazing tutorial which clearly explains how to interface to a real robot. However, I am facing an issue when launching the real robot. The error is as below

[ros2_control_node-2] [INFO] [1694504172.944274701] [resource_manager]: Loading hardware ‘RealRobot’
[ros2_control_node-2] [INFO] [1694504172.946497851] [resource_manager]: Initialize hardware ‘RealRobot’
[ros2_control_node-2] terminate called after throwing an instance of ‘std::invalid_argument’

I figured the error occurs in the ros2_control/hardware_interface/resource_manager.cpp file. The specific line where the error occurs I think is this:
const rclcpp_lifecycle::State new_state = hardware.initialize(hardware_info);

I’m using an Arduino Mega instead. I have tested my bot with the ros_arduino_bridge package and it works fine when running miniterm. Is there a way to resolve this? Thank you!

Sep '23

robotmaker

Hi, thank you for all your work on those videos, which I love learning from.

I’m trying to create my own robot under ROS 2 Humble. It seems that I have successfully managed to use Nav2. However, I don’t understand how ROS 2 Control is used by Nav2. What does Nav2 Controller Server and Planner use to work? And finally, the most important question: Is there any controller from ROS 2 Control for controlling a 3-wheel omnidirectional robot?

Sep '23

tadashi

Hey Josh,

First of all, thanks for all these great tutorials! They are helping me loads during my studies and thanks for replying. This is for a school project, so i appreciate all the help i can get.
I get the same error message as Samet_Elmaci in this thread:
Discussion - Changes for running mobile robot on Humble/Jammy - #14 by Samet_Elmaci .

Some information about my setup:
I am using ros2 humble in a docker container. I have the exact same hardware setup as you for ease of following your tutorials. I have forwarded the USB ports on the pi to the container, so i am able to get lidar data and control the motors. Therefore the container setup itself is not likely the issue.

I have cloned the repo for articubot_one (humble branch) and the error happens when i try to run the the launch_robot.launch.py. I have tried various things to fix the issue:

Things i am going to try:

Error message:
devuser@pi:/overlay_ws$ ros2 launch articubot_one launch_robot.launch.py
[INFO] [launch]: All log files can be found below /home/devuser/.ros/log/2023-09-26-11-54-50-619436-pi-2661
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [2663]
[INFO] [twist_mux-2]: process started with pid [2665]
[twist_mux-2] [INFO] [1695729293.661287767] [twist_mux]: Topic handler ‘topics.joystick’ subscribed to topic ‘cmd_vel_joy’: timeout = 0.500000s , priority = 100.
[twist_mux-2] [INFO] [1695729293.669544297] [twist_mux]: Topic handler ‘topics.navigation’ subscribed to topic ‘cmd_vel’: timeout = 0.500000s , priority = 10.
[twist_mux-2] [INFO] [1695729293.671005906] [twist_mux]: Topic handler ‘topics.tracker’ subscribed to topic ‘cmd_vel_tracker’: timeout = 0.500000s , priority = 20.
[robot_state_publisher-1] [INFO] [1695729293.707919896] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1695729293.708507536] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1695729293.708640478] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1695729293.708740736] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1695729293.708833883] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1695729293.708923104] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1695729293.709009436] [robot_state_publisher]: got segment face_link
[robot_state_publisher-1] [INFO] [1695729293.709094694] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1695729293.709181637] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1695729293.709267247] [robot_state_publisher]: got segment right_wheel
[INFO] [ros2_control_node-3]: process started with pid [2700]
[INFO] [spawner-4]: process started with pid [2702]
[INFO] [spawner-5]: process started with pid [2704]
[ros2_control_node-3] [INFO] [1695729302.263149623] [resource_manager]: Loading hardware ‘RealRobot’
[ros2_control_node-3] terminate called after throwing an instance of ‘pluginlib::LibraryLoadException’
[ros2_control_node-3] what(): According to the loaded plugin descriptions the class diffdrive_arduino/DiffDriveArduino with base class type hardware_interface::SystemInterface does not exist. Declared types are diffdrive_arduino/DiffDriveArduinoHardware fake_components/GenericSystem mock_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system
[ros2_control_node-3] Stack trace (most recent call last):
[ros2_control_node-3] #16 Object “/usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1”, at 0xffffffffffffffff, in
[ros2_control_node-3] #15 Object “/opt/ros/humble/lib/controller_manager/ros2_control_node”, at 0xaaaae2d52c6f, in
[ros2_control_node-3] #14 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffffa63274cb, in __libc_start_main
[ros2_control_node-3] #13 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffffa63273fb, in
[ros2_control_node-3] #12 Object “/opt/ros/humble/lib/controller_manager/ros2_control_node”, at 0xaaaae2d52767, in
[ros2_control_node-3] #11 Object “/opt/ros/humble/lib/libcontroller_manager.so”, at 0xffffa699cba7, in controller_manager::ControllerManager::ControllerManager(std::shared_ptrrclcpp::Executor, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, rclcpp::NodeOptions const&)
[ros2_control_node-3] #10 Object “/opt/ros/humble/lib/libcontroller_manager.so”, at 0xffffa699bfcf, in controller_manager::ControllerManager::init_resource_manager(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)
[ros2_control_node-3] #9 Object “/opt/ros/humble/lib/libhardware_interface.so”, at 0xffffa6197237, in hardware_interface::ResourceManager::load_urdf(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool)
[ros2_control_node-3] #8 Object “/opt/ros/humble/lib/libhardware_interface.so”, at 0xffffa61959e3, in
[ros2_control_node-3] #7 Object “/opt/ros/humble/lib/libhardware_interface.so”, at 0xffffa61a16b7, in
[ros2_control_node-3] #6 Object “/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30”, at 0xffffa6582e03, in __cxa_throw
[ros2_control_node-3] #5 Object “/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30”, at 0xffffa6582b1f, in std::terminate()
[ros2_control_node-3] #4 Object “/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30”, at 0xffffa6582abb, in
[ros2_control_node-3] #3 Object “/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30”, at 0xffffa65862db, in __gnu_cxx::__verbose_terminate_handler()
[ros2_control_node-3] #2 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffffa632712f, in abort
[ros2_control_node-3] #1 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffffa633a67b, in raise
[ros2_control_node-3] #0 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffffa637f200, in
[ros2_control_node-3] Aborted (Signal sent by tkill() 2700 1000)
[ERROR] [ros2_control_node-3]: process has died [pid 2700, exit code -6, cmd ‘/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_navrtmcw --params-file /overlay_ws/install/articubot_one/share/articubot_one/config/my_controllers.yaml’].
[spawner-4] [INFO] [1695729307.338964270] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1695729307.421576180] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1695729309.405147189] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1695729309.489268521] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1695729311.472865011] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1695729311.556779495] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1695729313.543320664] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1695729313.625254842] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [ERROR] [1695729315.200286903] [spawner_joint_broad]: Controller manager not available
[spawner-5] [ERROR] [1695729315.279275328] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner-4]: process has died [pid 2702, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args’].
[ERROR] [spawner-5]: process has died [pid 2704, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args’].

Oct '23

Mikhail_Andryievich

Hi,
I’m running directly on arduino and have the same issue.

ros2@robot:/home/robot_ws$ ros2 launch lunorobot launch_robot.launch.py
[INFO] [launch]: All log files can be found below /home/ros2/.ros/log/2023-10-03-17-12-02-039075-robot-4349
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [4350]
[robot_state_publisher-1] [INFO] [1696345922.974149735] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1696345922.974446916] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1696345922.974494767] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1696345922.974526341] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1696345922.974552155] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1696345922.974576322] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1696345922.974600988] [robot_state_publisher]: got segment right_wheel
[INFO] [ros2_control_node-2]: process started with pid [4388]
[INFO] [spawner-3]: process started with pid [4390]
[INFO] [spawner-4]: process started with pid [4392]
[ros2_control_node-2] [INFO] [1696345928.903734258] [resource_manager]: Loading hardware ‘RealRobot’
[ros2_control_node-2] terminate called after throwing an instance of ‘pluginlib::LibraryLoadException’
[ros2_control_node-2] what(): According to the loaded plugin descriptions the class diffdrive_arduino/DiffDriveArduino with base class type hardware_interface::SystemInterface does not exist. Declared types are diffdrive_arduino/DiffDriveArduinoHardware fake_components/GenericSystem mock_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system
[ros2_control_node-2] Stack trace (most recent call last):
[ros2_control_node-2] #16 Object “/usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1”, at 0xffffffffffffffff, in
[ros2_control_node-2] #15 Object “/opt/ros/humble/lib/controller_manager/ros2_control_node”, at 0xaaaaea4c2c6f, in
[ros2_control_node-2] #14 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffff9fb674cb, in __libc_start_main
[ros2_control_node-2] #13 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffff9fb673fb, in
[ros2_control_node-2] #12 Object “/opt/ros/humble/lib/controller_manager/ros2_control_node”, at 0xaaaaea4c2767, in
[ros2_control_node-2] #11 Object “/opt/ros/humble/lib/libcontroller_manager.so”, at 0xffffa01dd717, in controller_manager::ControllerManager::ControllerManager(std::shared_ptrrclcpp::Executor, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, rclcpp::NodeOptions const&)
[ros2_control_node-2] #10 Object “/opt/ros/humble/lib/libcontroller_manager.so”, at 0xffffa01dcb3f, in controller_manager::ControllerManager::init_resource_manager(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)
[ros2_control_node-2] #9 Object “/opt/ros/humble/lib/libhardware_interface.so”, at 0xffff9f9d7237, in hardware_interface::ResourceManager::load_urdf(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool)
[ros2_control_node-2] #8 Object “/opt/ros/humble/lib/libhardware_interface.so”, at 0xffff9f9d59e3, in
[ros2_control_node-2] #7 Object “/opt/ros/humble/lib/libhardware_interface.so”, at 0xffff9f9e16b7, in
[ros2_control_node-2] #6 Object “/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30”, at 0xffff9fdc2e03, in __cxa_throw
[ros2_control_node-2] #5 Object “/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30”, at 0xffff9fdc2b1f, in std::terminate()
[ros2_control_node-2] #4 Object “/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30”, at 0xffff9fdc2abb, in
[ros2_control_node-2] #3 Object “/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30”, at 0xffff9fdc62db, in __gnu_cxx::__verbose_terminate_handler()
[ros2_control_node-2] #2 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffff9fb6712f, in abort
[ros2_control_node-2] #1 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffff9fb7a67b, in raise
[ros2_control_node-2] #0 Object “/usr/lib/aarch64-linux-gnu/libc.so.6”, at 0xffff9fbbf200, in
[ros2_control_node-2] Aborted (Signal sent by tkill() 4388 1000)
[ERROR] [ros2_control_node-2]: process has died [pid 4388, exit code -6, cmd ‘/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_izmqttko --params-file /home/robot_ws/install/lunorobot/share/lunorobot/config/my_controllers.yaml’].
[spawner-3] [INFO] [1696345932.213156760] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1696345932.541984436] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-3] [INFO] [1696345934.271893949] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1696345934.602429954] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-3] [INFO] [1696345936.328438815] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1696345936.660799370] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist

Could you please help?

1 reply
Oct '23

Mikhail_Andryievich

Hi,

Solution found for Humble version
There are 3 issues in ros2_control.xacro file:

  1. the name of the plugin should be diffdrive_arduino/DiffDriveArduinoHardware
  2. the name of the timeout parameter should be timeout_ms
  3. the sequence of the state_interface should be position then velocity, see correct xml code below:
<ros2_control name="RealRobot" type="system">
        <hardware>
            <plugin>diffdrive_arduino/DiffDriveArduinoHardware</plugin>
            <param name="left_wheel_name">left_wheel_joint</param>
            <param name="right_wheel_name">right_wheel_joint</param>
            <param name="loop_rate">30</param>
            <param name="device">/dev/ttyUSB0</param>
            <param name="baud_rate">57600</param>
            <param name="timeout_ms">1000</param>
            <param name="enc_counts_per_rev">17280</param>
        </hardware>
        <!-- Note everything below here is the same as the Gazebo one -->
        <joint name="left_wheel_joint">
            <command_interface name="velocity">
                <param name="min">-10</param>
                <param name="max">10</param>
            </command_interface>
            <state_interface name="position"/>
            <state_interface name="velocity"/>
        </joint>
        <joint name="right_wheel_joint">
            <command_interface name="velocity">
                <param name="min">-10</param>
                <param name="max">10</param>
            </command_interface>
            <state_interface name="position"/>
            <state_interface name="velocity"/>
        </joint>
    </ros2_control> 
</robot>
1 reply
Oct '23

LeoCleaner

Hi Josh,
I find your videos awsome!!!
Would you mind to plan a topic also using some kind of 9dof sensor (for example bno055) for better navigation? Are they really needed or SLAM is enoough?

Thank you very much!

Cheers,
Ivo

Oct '23

The-Kriz

hi im new to Ros and needed some help. From the tutorials i have leard few thing and iwas able to build a 4WD diff_drive robot ( GitHub - The-Kriz/rog_ros_bot )

but was able to run the bot in sim, but didnt have the luck to make the actual bot run as i coudint figure out how to write code for the hardware part ( i only know basic arduino code )

can someone help me to convert or let me know what all i should change from the provided code for 2WD diff_drive to 4WD diff_drive

thanks you,
Kriz

Oct '23

Mano

HI,
It was a great lecture, thanks for sharing with us. I was able to follow most part of it, but i was unable to understand how input and output ports are connected in the hardware interface plugin.

thanks a lot for sharing with us.

Oct '23

Robotawi

Hi @JoshNewans
Thank you for the great work!

I have a question and would appreciate your help.

Could you please explain the rationale behind the specific formula used in the setMotorValues method for converting angular velocity to encoder counts per control loop iteration?

arduino_.setMotorValues(l_wheel_.cmd / l_wheel_.rads_per_count / cfg_.loop_rate, r_wheel_.cmd / r_wheel_.rads_per_count / cfg_.loop_rate);

Specifically, why are the desired angular velocities divided by both the rads_per_count conversion factor and the loop_rate ?

If I were to adapt this code for a different robot with different hardware or control requirements, what aspects of this line would I need to modify?

Nov '23

eaganrodegard

I seem to be having a problem with the teleop_twist_joy node not auto-repeating.

I used ros2 topic echo /diff_cont/cmd_vel_unstamped to monitor the command being sent when I was using the joy stick to control the robot.

Initial I would see the command and the robot would move. But after a few seconds, no more commands would be sent even when the joystick is held full forward with the enable button pressed.

I have the “autorepeat_rate” set to 20.0 in the joystick.yaml file.

What am I missing?

Any ideas would be welcome. Thank you

Nov '23

nam_Duong

I watched the video “You can use ANY hardware with ros2_control”, I downloaded the code of that video, The purpose of that code is that I want to use the frame available in the code to connect to the arduino mega board. Currently I am in the stage of connecting ros2_control to arduino through the code framework available in the video, But I have connection problems when launching the diffbot.launch.py file, currently I am working on the ros_humble version. I’m really sorry that my English sentence seems grammatically incorrect. Thank you everyone for your help.
I just edited the device parameter:

/dev/serial/by-path/pci-0000\:05\:00.3-usb-0\:2\:1.0 error: namdc@Nam20195107:~/project_arduino$ ros2 launch diffdrive_arduino diffbot.launch.py [INFO] [launch]: All log files can be found below /home/namdc/.ros/log/2023-11-25-12-52-15-389354-Nam20195107-10120 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [ros2_control_node-1]: process started with pid [10123] [INFO] [robot_state_publisher-2]: process started with pid [10125] [INFO] [spawner-3]: process started with pid [10127] [ros2_control_node-1] [INFO] [1700891536.231110072] [resource_manager]: Loading hardware 'DiffBot' [ros2_control_node-1] [INFO] [1700891536.232843117] [resource_manager]: Initialize hardware 'DiffBot' [ros2_control_node-1] [INFO] [1700891536.233266397] [resource_manager]: Successful initialization of hardware 'DiffBot' [ros2_control_node-1] [INFO] [1700891536.233504397] [resource_manager]: 'configure' hardware 'DiffBot' [ros2_control_node-1] [INFO] [1700891536.233545464] [DiffDriveArduinoHardware]: Configuring ...please wait... [ros2_control_node-1] terminate called after throwing an instance of 'LibSerial::OpenFailed' [ros2_control_node-1] what(): Bad file descriptor [ros2_control_node-1] Stack trace (most recent call last): [robot_state_publisher-2] [WARN] [1700891536.235810194] [kdl_parser]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [robot_state_publisher-2] [INFO] [1700891536.236364170] [robot_state_publisher]: got segment base_link [robot_state_publisher-2] [INFO] [1700891536.236486892] [robot_state_publisher]: got segment caster_frontal_wheel [robot_state_publisher-2] [INFO] [1700891536.236504515] [robot_state_publisher]: got segment caster_rear_wheel [robot_state_publisher-2] [INFO] [1700891536.236517450] [robot_state_publisher]: got segment left_wheel [robot_state_publisher-2] [INFO] [1700891536.236529713] [robot_state_publisher]: got segment right_wheel [ros2_control_node-1] #22 Object "", at 0xffffffffffffffff, in [ros2_control_node-1] #21 Object "/opt/ros/humble/lib/controller_manager/ros2_control_node", at 0x55ebb695dd84, in [ros2_control_node-1] #20 Source "../csu/libc-start.c", line 392, in __libc_start_main_impl [0x7faad2c29e3f] [ros2_control_node-1] #19 Source "../sysdeps/nptl/libc_start_call_main.h", line 58, in __libc_start_call_main [0x7faad2c29d8f] [ros2_control_node-1] #18 Object "/opt/ros/humble/lib/controller_manager/ros2_control_node", at 0x55ebb695d89e, in [ros2_control_node-1] #17 Object "/opt/ros/humble/lib/libcontroller_manager.so", at 0x7faad3657661, in controller_manager::ControllerManager::ControllerManager(std::shared_ptr, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, rclcpp::NodeOptions const&) [ros2_control_node-1] #16 Object "/opt/ros/humble/lib/libcontroller_manager.so", at 0x7faad3656b2e, in controller_manager::ControllerManager::init_resource_manager(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) [ros2_control_node-1] #15 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad32f8900, in hardware_interface::ResourceManager::activate_all_components() [ros2_control_node-1] #14 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad32f80bb, in hardware_interface::ResourceManager::set_component_state(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, rclcpp_lifecycle::State&) [ros2_control_node-1] #13 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad32f95e2, in bool hardware_interface::ResourceStorage::set_component_state(hardware_interface::System&, rclcpp_lifecycle::State const&) [ros2_control_node-1] #12 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad330489b, in [ros2_control_node-1] #11 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad331aaeb, in [ros2_control_node-1] #10 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7faad3312776, in hardware_interface::System::configure() [ros2_control_node-1] #9 Object "/home/namdc/project_arduino/install/diffdrive_arduino/lib/libdiffdrive_arduino.so", at 0x7faacd614b24, in diffdrive_arduino::DiffDriveArduinoHardware::on_configure(rclcpp_lifecycle::State const&) [ros2_control_node-1] #8 Object "/home/namdc/project_arduino/install/diffdrive_arduino/lib/libdiffdrive_arduino.so", at 0x7faacd61765c, in ArduinoComms::connect(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int) [ros2_control_node-1] #7 Object "/usr/lib/x86_64-linux-gnu/libserial.so.1.0.0", at 0x7faacd5a40b3, in [ros2_control_node-1] #6 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7faad30ae4d7, in __cxa_throw [ros2_control_node-1] #5 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7faad30ae276, in std::terminate() [ros2_control_node-1] #4 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7faad30ae20b, in [ros2_control_node-1] #3 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7faad30a2b9d, in [ros2_control_node-1] #2 Source "./stdlib/abort.c", line 79, in abort [0x7faad2c287f2] [ros2_control_node-1] #1 Source "../sysdeps/posix/raise.c", line 26, in raise [0x7faad2c42475] [ros2_control_node-1] #0 | Source "./nptl/pthread_kill.c", line 89, in __pthread_kill_internal [ros2_control_node-1] | Source "./nptl/pthread_kill.c", line 78, in __pthread_kill_implementation [ros2_control_node-1] Source "./nptl/pthread_kill.c", line 44, in __pthread_kill [0x7faad2c969fc] [ros2_control_node-1] Aborted (Signal sent by tkill() 10123 1000) [ERROR] [ros2_control_node-1]: process has died [pid 10123, exit code -6, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_xpux93li --params-file /home/namdc/project_arduino/install/diffdrive_arduino/share/diffdrive_arduino/config/diffbot_controllers.yaml']. [spawner-3] [INFO] [1700891538.812032991] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-3] [INFO] [1700891540.830612800] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-3] [INFO] [1700891542.849569356] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-3] [INFO] [1700891544.867227744] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist [spawner-3] [ERROR] [1700891546.883473615] [spawner_joint_state_broadcaster]: Controller manager not available [ERROR] [spawner-3]: process has died [pid 10127, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager /controller_manager --ros-args']. [INFO] [spawner-4]: process started with pid [10167] [INFO] [rviz2-5]: process started with pid [10169] [rviz2-5] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. [rviz2-5] [INFO] [1700891547.947906029] [rviz2]: Stereo is NOT SUPPORTED [rviz2-5] [INFO] [1700891547.948230081] [rviz2]: OpenGl version: 4.6 (GLSL 4.6) [rviz2-5] [INFO] [1700891547.987819732] [rviz2]: Stereo is NOT SUPPORTED [rviz2-5] [ERROR] [1700891548.258911760] [rviz2]: The link is static or has unrealistic inertia, so the equivalent inertia box will not be shown. [rviz2-5] [rviz2-5] [ERROR] [1700891548.259194124] [rviz2]: The link is static or has unrealistic inertia, so the equivalent inertia box will not be shown. [rviz2-5] [spawner-4] [INFO] [1700891549.758581685] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist [spawner-4] [INFO] [1700891551.777160247] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist [spawner-4] [INFO] [1700891553.793324662] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist [spawner-4] [INFO] [1700891555.810854949] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist [spawner-4] [ERROR] [1700891557.828001767] [spawner_diffbot_base_controller]: Controller manager not available [ERROR] [spawner-4]: process has died [pid 10167, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diffbot_base_controller --controller-manager /controller_manager --ros-args'].
Nov '23

Shah

Thank you very much @JoshNewans for such a useful content! I’m facing one issue. My real robot wheels are moving fine but in rviz2 it is not moving. The tf is also not moving. Fixed frame is ‘odom’. Tried other fixed frame but of no avail. Don’t know the real problem. If anyone knows about this issue, please help me out. Thanks once again.

Nov '23

Mostafa

Hi @JoshNewans I have learned a lot from your tutorials and applying them on my graduation project so thank you for all the work you have done I would not got anywhere without your generous help
I have been running into issues when I run the “launch_robot.launch.py” on the RasberryPi while it works perfectly on my laptop and in both cases the Arduino board works fine but I do not seem to load “diff_cont” for some reason on the Pi here is the error I get

[INFO] [ros2_control_node-4]: process started with pid [196016]
[INFO] [spawner-5]: process started with pid [196018]
[INFO] [spawner-6]: process started with pid [196020]
[ros2_control_node-4] [INFO] [1700919705.073008620] [resource_manager]: Loading hardware 'RealRobot' 
[ros2_control_node-4] [INFO] [1700919705.094977924] [resource_manager]: Initialize hardware 'RealRobot' 
[ros2_control_node-4] [INFO] [1700919705.098197162] [DiffDriveArduino]: Configuring...
[ros2_control_node-4] [INFO] [1700919705.128308250] [DiffDriveArduino]: Finished Configuration
[ros2_control_node-4] [INFO] [1700919705.128477832] [resource_manager]: Successful initialization of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919705.129383249] [resource_manager]: 'configure' hardware 'RealRobot' 
[ros2_control_node-4] [INFO] [1700919705.129478457] [resource_manager]: Successful 'configure' of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919705.129508218] [resource_manager]: 'activate' hardware 'RealRobot' 
[ros2_control_node-4] [INFO] [1700919705.129532016] [DiffDriveArduino]: Starting Controller...
[ros2_control_node-4] [INFO] [1700919706.134547443] [resource_manager]: Successful 'activate' of hardware 'RealRobot'
[ros2_control_node-4] [INFO] [1700919706.271511173] [controller_manager]: update rate is 30 Hz
[ros2_control_node-4] [INFO] [1700919706.288859315] [controller_manager]: RT kernel is recommended for better performance
[ros2_control_node-4] [INFO] [1700919707.306182869] [controller_manager]: Loading controller 'joint_broad'
[ros2_control_node-4] [INFO] [1700919707.525818714] [controller_manager]: Loading controller 'diff_cont'
[ros2_control_node-4] [ERROR] [1700919707.525999760] [controller_manager]: Loader for controller 'diff_cont' (type 'diff_drive_controller/DiffDriveController') not found.
[ros2_control_node-4] [INFO] [1700919707.526040966] [controller_manager]: Available classes:
[ros2_control_node-4] [INFO] [1700919707.526075634] [controller_manager]:   controller_manager/test_controller
[ros2_control_node-4] [INFO] [1700919707.526103543] [controller_manager]:   controller_manager/test_controller_failed_init
[ros2_control_node-4] [INFO] [1700919707.526129859] [controller_manager]:   controller_manager/test_controller_with_interfaces
[ros2_control_node-4] [INFO] [1700919707.526158527] [controller_manager]:   joint_state_broadcaster/JointStateBroadcaster
[ros2_control_node-4] [INFO] [1700919707.526212030] [controller_manager]:   joint_trajectory_controller/JointTrajectoryController
[ros2_control_node-4] [INFO] [1700919707.528960763] [controller_manager]:   controller_manager/test_chainable_controller
[spawner-6] [FATAL] [1700919707.533096584] [spawner_diff_cont]: Failed loading controller diff_cont
[spawner-5] [INFO] [1700919707.759520886] [spawner_joint_broad]: Loaded joint_broad
[ros2_control_node-4] [INFO] [1700919707.765827910] [controller_manager]: Configuring controller 'joint_broad'
[ros2_control_node-4] [INFO] [1700919707.766330214] [joint_broad]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[spawner-5] [INFO] [1700919707.954555349] [spawner_joint_broad]: Configured and activated joint_broad
[ERROR] [spawner-6]: process has died [pid 196020, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args'].
[INFO] [spawner-5]: process has finished cleanly [pid 196018]

my initial thoughts that it dose not see the “my_controllers.yaml” file but it runs the “joint_broad” without any problems

Nov '23

ali_ghasemi

Hi Josh!
I’m planning to simulate an AUV for 3D underwater object tracking with camera sensor using ROS and Gazebo. Do you have Any recommendations on the ROS version, Gazebo version, and plugins for simulation this scenario? or GitHub directory?

Nov '23

Agnes_Soesanto

hello, i have problem with the diffdrive_arduino, it can’t be compiled. im using the ubuntu 22.04 with ros humble and i can install the ros-foxy, so i use the ros-humble. but after i install the ros-humble-ros2-control & ros-humble-ros2-controllers the diffdrive_arduino still won’t compiled. can u help me?? thankyou
agnes@raspberrypi:~/ros2_ws$ colcon build --symlink-install
[8.185s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
‘rplidar_ros’ is in: /home/agnes/ros2_ws/install/rplidar_ros
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
–allow-overriding rplidar_ros

This may be promoted to an error in a future release of colcon-override-check.
Starting >>> serial
Starting >>> articubot_one
Starting >>> ldlidar_stl_ros2
Starting >>> rplidar_ros
Finished <<< articubot_one [3.33s]
Finished <<< ldlidar_stl_ros2 [3.37s]
Finished <<< serial [4.88s]
Starting >>> diffdrive_arduino
Finished <<< rplidar_ros [4.61s]
— stderr: diffdrive_arduino
In file included from /home/agnes/ros2_ws/src/diffdrive_arduino/src/fake_robot.cpp:1:
/home/agnes/ros2_ws/src/diffdrive_arduino/include/diffdrive_arduino/fake_robot.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
7 | #include “hardware_interface/base_interface.hpp”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/fake_robot.dir/build.make:76: CMakeFiles/fake_robot.dir/src/fake_robot.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/fake_robot.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs…
In file included from /home/agnes/ros2_ws/src/diffdrive_arduino/src/diffdrive_arduino.cpp:1:
/home/agnes/ros2_ws/src/diffdrive_arduino/include/diffdrive_arduino/diffdrive_arduino.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
7 | #include “hardware_interface/base_interface.hpp”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/diffdrive_arduino.dir/build.make:76: CMakeFiles/diffdrive_arduino.dir/src/diffdrive_arduino.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/diffdrive_arduino.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Failed <<< diffdrive_arduino [3.85s, exited with code 2]

Summary: 4 packages finished [14.0s]
1 package failed: diffdrive_arduino
1 package had stderr output: diffdrive_arduino

1 reply
Dec '23

Omar_Khaled

hello Mr joshNewans i have a problem when i try to run this command ros2 launch articubot_one launch_robot.launch.py
the error is :
[INFO] [launch]: All log files can be found below /home/omar/.ros/log/2023-12-19-14-15-50-067095-omarlegiony540-15500
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [15503]
[INFO] [twist_mux-2]: process started with pid [15505]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link base_footprint had 0 children
[robot_state_publisher-1] Link chassis had 3 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link caster_wheel had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] [INFO] [1702988150.253367756] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1702988150.253457840] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1702988150.253472042] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1702988150.253482521] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1702988150.253492593] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1702988150.253502422] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1702988150.253512065] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1702988150.253521801] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1702988150.253531529] [robot_state_publisher]: got segment right_wheel
[twist_mux-2] [INFO] [1702988150.253417560] [twist_mux]: Topic handler ‘topics.joystick’ subscribed to topic ‘cmd_vel_joy’: timeout = 0.500000s , priority = 100.
[twist_mux-2] [INFO] [1702988150.253767902] [twist_mux]: Topic handler ‘topics.navigation’ subscribed to topic ‘cmd_vel’: timeout = 0.500000s , priority = 10.
[twist_mux-2] [INFO] [1702988150.253950440] [twist_mux]: Topic handler ‘topics.tracker’ subscribed to topic ‘cmd_vel_tracker’: timeout = 0.500000s , priority = 20.
[INFO] [ros2_control_node-3]: process started with pid [15541]
[INFO] [spawner.py-4]: process started with pid [15543]
[INFO] [spawner.py-5]: process started with pid [15545]
[ros2_control_node-3] terminate called after throwing an instance of ‘pluginlib::LibraryLoadException’
[ros2_control_node-3] what(): According to the loaded plugin descriptions the class diffdrive_arduino/DiffDriveArduino with base class type hardware_interface::SystemInterface does not exist. Declared types are fake_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system turtlebot3_manipulation_hardware/TurtleBot3ManipulationSystemHardware
[spawner.py-4] [INFO] [1702988154.738035052] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988154.742421839] [spawner_diff_cont]: Waiting for /controller_manager services
[ERROR] [ros2_control_node-3]: process has died [pid 15541, exit code -6, cmd ‘/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_i511tc0_ --params-file /home/omar/colcon_ws/install/articubot_one/share/articubot_one/config/my_controllers.yaml’].
[spawner.py-4] [INFO] [1702988156.754901118] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988156.758037875] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1702988158.770261931] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988158.773408347] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1702988160.788893056] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988160.791728848] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-4] [INFO] [1702988162.807066439] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1702988162.811132170] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-4] [ERROR] [1702988164.823391319] [spawner_joint_broad]: Controller manager not available
[spawner.py-5] [ERROR] [1702988164.828567043] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner.py-4]: process has died [pid 15543, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args’].
[ERROR] [spawner.py-5]: process has died [pid 15545, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args’].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[twist_mux-2] [INFO] [1702988175.110388053] [rclcpp]: signal_handler(signal_value=2)
[robot_state_publisher-1] [INFO] [1702988175.110824006] [rclcpp]: signal_handler(signal_value=2)
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 15503]
[INFO] [twist_mux-2]: process has finished cleanly [pid 15505]

Dec '23

Aboude_zoua

Hi Josh ,
I’m having the same issue like others with controller manager some how is not working .
I’ve been stuck in this for 4 days now with no luck ! any chance you recommend something ? I echo /cmd_vel_unstamped in robot and I can see the values passing
[spawner-4] [INFO] [1703827838.665064167] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1703827838.785338511] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1703827840.711671532] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1703827840.828404607] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1703827842.760930707] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1703827842.877129094] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [INFO] [1703827844.805368341] [spawner_joint_broad]: Waiting for ‘/controller_manager’ node to exist
[spawner-5] [INFO] [1703827844.923151119] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[spawner-4] [ERROR] [1703827846.646826040] [spawner_joint_broad]: Controller manager not available
[spawner-5] [ERROR] [1703827846.763479498] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner-4]: process has died [pid 7297, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args’].
[ERROR] [spawner-5]: process has died [pid 7299, exit code 1, cmd ‘/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args’].

Also I ran controller_manager and no connection
ros2 run controller_manager spawner diff_cont
[INFO] [1703828709.701625640] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1703828711.722023739] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1703828713.742430911] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[INFO] [1703828715.764174999] [spawner_diff_cont]: Waiting for ‘/controller_manager’ node to exist
[ERROR] [1703828717.784713751] [spawner_diff_cont]: Controller manager not available
[ros2run]: Process exited with failure 1

1 reply
Dec '23 ▶ Agnes_Soesanto

Aboude_zoua

make you clone the " humble " Branch from josh repo . This should solve your issue .

Dec '23 ▶ JoshNewans

Omar_Khaled

Hi Josh,
i am trying to launch launch_robot.lauch.py but in my dev machine to try the motors with teleop and i got this problem when launch it (Note i donot have diffarduino_drive in my packages and when i try to have it and build it , it give me error)
[INFO] [launch]: All log files can be found below /home/omar/.ros/log/2023-12-30-21-04-24-680391-omarlegiony540-26297
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [26300]
[INFO] [twist_mux-2]: process started with pid [26302]
[twist_mux-2] [INFO] [1703963064.968940347] [twist_mux]: Topic handler ‘topics.joystick’ subscribed to topic ‘cmd_vel_joy’: timeout = 0.500000s , priority = 100.
[twist_mux-2] [INFO] [1703963064.969531345] [twist_mux]: Topic handler ‘topics.navigation’ subscribed to topic ‘cmd_vel’: timeout = 0.500000s , priority = 10.
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link base_footprint had 0 children
[robot_state_publisher-1] Link chassis had 2 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link leftb_wheel had 0 children
[robot_state_publisher-1] Link leftf_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] Link rightb_wheel had 0 children
[robot_state_publisher-1] Link rightf_wheel had 0 children
[robot_state_publisher-1] [INFO] [1703963064.974543580] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1703963064.974624726] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1703963064.974637111] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1703963064.974645299] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1703963064.974652976] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1703963064.974660158] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1703963064.974666931] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1703963064.974673816] [robot_state_publisher]: got segment leftb_wheel
[robot_state_publisher-1] [INFO] [1703963064.974680677] [robot_state_publisher]: got segment leftf_wheel
[robot_state_publisher-1] [INFO] [1703963064.974687395] [robot_state_publisher]: got segment right_wheel
[robot_state_publisher-1] [INFO] [1703963064.974694133] [robot_state_publisher]: got segment rightb_wheel
[robot_state_publisher-1] [INFO] [1703963064.974701012] [robot_state_publisher]: got segment rightf_wheel
[INFO] [ros2_control_node-3]: process started with pid [26338]
[INFO] [spawner.py-4]: process started with pid [26340]
[INFO] [spawner.py-5]: process started with pid [26342]
[ros2_control_node-3] terminate called after throwing an instance of ‘pluginlib::LibraryLoadException’
[ros2_control_node-3] what(): According to the loaded plugin descriptions the class diffdrive_arduino/DiffDriveArduino with base class type hardware_interface::SystemInterface does not exist. Declared types are fake_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system
[spawner.py-4] [INFO] [1703963069.430926611] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1703963069.431065690] [spawner_diff_cont]: Waiting for /controller_manager services
[ERROR] [ros2_control_node-3]: process has died [pid 26338, exit code -6, cmd ‘/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_8fuljyhu --params-file /home/omar/real_ws/install/medo/share/medo/config/my_controllers.yaml’].
[spawner.py-4] [INFO] [1703963071.446737365] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1703963071.447554445] [spawner_diff_cont]: Waiting for /controller_manager services
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[twist_mux-2] [INFO] [1703963073.455811200] [rclcpp]: signal_handler(signal_value=2)
[robot_state_publisher-1] [INFO] [1703963073.455834934] [rclcpp]: signal_handler(signal_value=2)
[spawner.py-5] Traceback (most recent call last):
[spawner.py-5] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 204, in
[spawner.py-5] sys.exit(main())
[spawner.py-5] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 118, in main
[spawner.py-5] if not wait_for_controller_manager(node, controller_manager_name,
[spawner.py-5] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 59, in wait_for_controller_manager
[spawner.py-5] time.sleep(0.2)
[spawner.py-5] KeyboardInterrupt
[spawner.py-4] Traceback (most recent call last):
[spawner.py-4] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 204, in
[spawner.py-4] sys.exit(main())
[spawner.py-4] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 118, in main
[spawner.py-4] if not wait_for_controller_manager(node, controller_manager_name,
[spawner.py-4] File “/opt/ros/foxy/lib/controller_manager/spawner.py”, line 59, in wait_for_controller_manager
[spawner.py-4] time.sleep(0.2)
[spawner.py-4] KeyboardInterrupt
[INFO] [twist_mux-2]: process has finished cleanly [pid 26302]
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 26300]
[ERROR] [spawner.py-5]: process has died [pid 26342, exit code -2, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args’].
[ERROR] [spawner.py-4]: process has died [pid 26340, exit code -2, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args’].

Dec '23 ▶ Aboude_zoua

Aboude_zoua

I was able to resolve this issue by cloning the repo from buzzology github and then rebuilt the whole project with colcon .

Jan '24

omar_salah

hey Josh, thanks for the amazing tutorial and the generous content in general
i see you have commented on this issue before but i can’t seem to figure it out yet it happens on both the machine and the pi
[spawner.py-6] [INFO] [1704429643.856203298] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1704429643.945700660] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1704429645.866817026] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1704429645.955195869] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1704429647.880334317] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1704429647.967992784] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1704429649.896868913] [spawner_joint_broad]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1704429649.984468641] [spawner_diff_cont]: Waiting for /controller_manager services
[spawner.py-6] [ERROR] [1704429651.911524114] [spawner_joint_broad]: Controller manager not available
[ERROR] [spawner.py-6]: process has died [pid 9922, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py joint_broad --ros-args’].
[spawner.py-5] [ERROR] [1704429651.999166283] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner.py-5]: process has died [pid 9920, exit code 1, cmd ‘/opt/ros/foxy/lib/controller_manager/spawner.py diff_cont --ros-args’].

Jan '24 ▶ Douglas_Beach

jonnyr

See the documentation on the hardware_interface for the ros2_control, on github

Migration from Foxy to newer versions

Between Foxy and Galactic we made substantial changes to the interface of hardware components to enable management of their lifecycle. The following list shows a set of quick changes to port existing hardware components to Galactic:

  1. Rename configure to on_init and change return type to CallbackReturn
  2. If using BaseInterface as base class then you should remove it. Specifically, change:

hardware_interface::BaseInterface<hardware_interface::[Actuator|Sensor|System]Interface>

to

hardware_interface::[Actuator|Sensor|System]Interface

Jan '24 ▶ Afiq003

martoliod

Hey @Afiq003,
i got the same error… but as @JoshNewans:

i’m a bit confused by your solution.

what exactly did u do to resolve this? Thanks alot in advance!

EDIT: found the issue. in rsp.launch.py i needed to insert an blank before the “sim_mode” parameter as follows:

old:

robot_description_config = Command(['xacro ‘, xacro_file, ’ use_ros2_control:=’, use_ros2_control, ‘sim_mode:=’, use_sim_time])

new:

robot_description_config = Command([‘xacro ‘, xacro_file, ’ use_ros2_control:=’, use_ros2_control, ’ sim_mode:=’, use_sim_time])

Mar '24

KaushikBoora

Hi @JoshNewans thanks a lot for the videos, They helped me a lot to understand ROS2 and how to build a differential drive bot. I am working on a 4 WD and have been following your tutorials until " [Using ros2_control to drive our robot (off the edge of the bench...)](https://www.youtube.com/watch?v=4VVrTCnxvSw&t=601s)" video. I am facing some trouble after changing to ros2_control, The issue is that my robot is not moving either left or right in gazebo but it seems to move in Rviz as expected. I have searched all the online resources but did not find anything that helps.
here is the link to my repo GitHub - BooraKaushik/autobot
Video of what is happening, IMG_5920.mov - Google Drive
as you can see it is turning fine in rviz but not in gazebo.

I would really appreciate any help.
Thanks,
Kaushik Boora

Mar '24

Hamza_Anwar

Hi guys. I am new to ROS2 and I am following @JoshNewans tutorial to make my own robot. I am using an arduino uno board with polulu motors. I was able to make the robot work in gazebo/rviz but when I downloaded the diffdrive controller from Josh’ github and started to port it on the robot using RPI 3b+, I get the error:

ros2 launch adrover_ROS2 launch_robot.launch.py
[INFO] [launch]: All log files can be found below /home/adrover/.ros/log/2024-03-20-14-58-26-819462-adrover-2942
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [2945]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link chassis_link_back had 1 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link chassis_link_front had 1 children
[robot_state_publisher-1] Link lcd_link had 1 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link chassis_link_left had 2 children
[robot_state_publisher-1] Link caster_wheel_link_lb had 0 children
[robot_state_publisher-1] Link caster_wheel_link_lf had 0 children
[robot_state_publisher-1] Link chassis_link_right had 2 children
[robot_state_publisher-1] Link caster_wheel_link_rb had 0 children
[robot_state_publisher-1] Link caster_wheel_link_rf had 0 children
[robot_state_publisher-1] Link left_wheel_link had 0 children
[robot_state_publisher-1] Link right_wheel_link had 0 children
[robot_state_publisher-1] [INFO] [1710928708.453907263] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1710928708.454549749] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1710928708.454657611] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1710928708.454703444] [robot_state_publisher]: got segment caster_wheel_link_lb
[robot_state_publisher-1] [INFO] [1710928708.454747245] [robot_state_publisher]: got segment caster_wheel_link_lf
[robot_state_publisher-1] [INFO] [1710928708.454788963] [robot_state_publisher]: got segment caster_wheel_link_rb
[robot_state_publisher-1] [INFO] [1710928708.454830316] [robot_state_publisher]: got segment caster_wheel_link_rf
[robot_state_publisher-1] [INFO] [1710928708.454871253] [robot_state_publisher]: got segment chassis_link_back
[robot_state_publisher-1] [INFO] [1710928708.454913543] [robot_state_publisher]: got segment chassis_link_front
[robot_state_publisher-1] [INFO] [1710928708.454954636] [robot_state_publisher]: got segment chassis_link_left
[robot_state_publisher-1] [INFO] [1710928708.454996562] [robot_state_publisher]: got segment chassis_link_right
[robot_state_publisher-1] [INFO] [1710928708.455047186] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1710928708.455090831] [robot_state_publisher]: got segment lcd_link
[robot_state_publisher-1] [INFO] [1710928708.455134007] [robot_state_publisher]: got segment left_wheel_link
[robot_state_publisher-1] [INFO] [1710928708.455264005] [robot_state_publisher]: got segment right_wheel_link
[INFO] [ros2_control_node-2]: process started with pid [2957]
[ros2_control_node-2] terminate called after throwing an instance of 'std::runtime_error'
[ros2_control_node-2]   what():  invalid URDF passed in to robot parser
[ERROR] [ros2_control_node-2]: process has died [pid 2957, exit code -6, cmd '/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_y8g2xwtv --params-file /home/adrover/adrover_ws/install/adrover_ROS2/share/adrover_ROS2/config/adrover_controller.yaml'].

I have commented out the spawner in my launch files since the controller manager terminates automatically. Also my description file looks like:

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

    <ros2_control name="RealRobot" type="system">

        <hardware>
            <plugin>diffdrive_arduino/DiffDriveArduino</plugin>
            <param name="left_wheel_names">left_wheel_joint</param>
            <param name="right_wheel_names">right_wheel_joint</param>
            <param name="loop_rate">30</param>
            <param name="device">/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0</param>
            <param name="baud_rate">57600</param>
            <param name="timeout">1000</param>
            <param name="enc_counts_per_rev">8400</param>
        </hardware>

        <joint name="left_wheel_joint">
            <command_interface name="velocity">
                <param name="min">-10</param>
                <param name="max">10</param>
            </command_interface>
            <state_interface name="velocity" />
            <state_interface name="position" />
        </joint>

        <joint name="right_wheel_joint">
            <command_interface name="velocity">
                <param name="min">-10</param>
                <param name="max">10</param>
            </command_interface>
            <state_interface name="velocity" />
            <state_interface name="position" />
        </joint>

    </ros2_control>
        <gazebo>
        <plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
            <parameters>$(find adrover_ROS2)/config/adrover_controller.yaml</parameters>
        </plugin>
    </gazebo>

</robot>

Kindly any help in this regard?

1 reply
Mar '24

UNAIB_USMANI

hi , i m an issue while launch ros2 control list hardware interface output will coming like this could not contact to service controller manager

can anyone please help me out

Mar '24 ▶ Hamza_Anwar

Hamza_Anwar

It worked for me. For reference, I switched to ROS foxy but the issue persisted. I was connected to RPi over ssh and using nano for editing. I ultimately connected to vscode over remote connection, replaced all my code with the snippets provided in the blog by Josh ( I did this to ros2_control.xacroa and the launch_robot.launch.py files though I couldn’t see any difference between the two), removed the gazebo_control part completely instead of commenting it out and recompiled and run the launch file. It worked… Thankyou everyone and specially @JoshNewans for these great tutorials.

Apr '24

Lakess

Hi Josh
I’m trying to run “ros2 launch articubot_one launch_robot.launch.py” but get this error, I wonder if you can guide me to a solution. Thanks

[INFO] [launch]: All log files can be found below /home/diaz/.ros/log/2024-04-04-06-44-23-550460-diaz-desktop-13685
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [13688]
[robot_state_publisher-1] 1712227464.651032 [0] robot_stat: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link chassis had 4 children
[robot_state_publisher-1] Link camera_link had 1 children
[robot_state_publisher-1] Link camera_link_optical had 0 children
[robot_state_publisher-1] Link caster_wheel had 0 children
[robot_state_publisher-1] Link face_link had 0 children
[robot_state_publisher-1] Link laser_frame had 0 children
[robot_state_publisher-1] Link left_wheel had 0 children
[robot_state_publisher-1] Link right_wheel had 0 children
[robot_state_publisher-1] [INFO] [1712227464.679112441] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1712227464.679405597] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1712227464.679503966] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1712227464.679596512] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1712227464.679661025] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1712227464.679858499] [robot_state_publisher]: got segment face_link
[robot_state_publisher-1] [INFO] [1712227464.679919908] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1712227464.679992325] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1712227464.680050182] [robot_state_publisher]: got segment right_wheel
Task exception was never retrieved
future: <Task finished name=‘Task-12’ coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=SubstitutionFailure(‘executed command showed stderr output. Command: ros2 param get --hide-type /robot_state_publisher robot_description\nCaptured stderr output:\n1712227469.524891 [0] ros2: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0\n1712227470.409871 [0] ros2: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0\n’)>
Traceback (most recent call last):
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py”, line 228, in _process_one_event
await self.__process_event(next_event)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py”, line 248, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py”, line 108, in visit
return self.execute(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py”, line 444, in execute
self._perform_substitutions(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py”, line 399, in _perform_substitutions
evaluated_parameters = evaluate_parameters(context, self.__parameters)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py”, line 164, in evaluate_parameters
output_params.append(evaluate_parameter_dict(context, param))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py”, line 71, in evaluate_parameter_dict
evaluated_value = perform_substitutions(context, list(value))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py”, line 26, in perform_substitutions
return ‘’.join([context.perform_substitution(sub) for sub in subs])
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py”, line 26, in
return ‘’.join([context.perform_substitution(sub) for sub in subs])
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py”, line 232, in perform_substitution
return substitution.perform(self)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/substitutions/command.py”, line 122, in perform
raise SubstitutionFailure(on_stderr_message)
launch.substitutions.substitution_failure.SubstitutionFailure: executed command showed stderr output. Command: ros2 param get --hide-type /robot_state_publisher robot_description
Captured stderr output:
1712227469.524891 [0] ros2: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0
1712227470.409871 [0] ros2: using network interface wlan0 (udp/192.168.1.107) selected arbitrarily from: wlan0, docker0

^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-1] [INFO] [1712228830.109878910] [rclcpp]: signal_handler(signal_value=2)
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 13688]

May '24

glassTransition

I’ve been banging on this for some time and would appreciate any help that someone can offer. I’ve followed the update instructions for Humble to the best of my ability and can run everything in the simulated environment. The error comes when I try to run on the real robot. I get this error:

[ros2_control_node-3] [WARN] [1717166914.463673109] [controller_manager]: [Deprecated] Passing the robot description parameter directly to the control_manager node is deprecated. Use ‘~/robot_description’ topic from ‘robot_state_publisher’ instead.
[ros2_control_node-3] [INFO] [1717168386.815847187] [resource_manager]: Loading hardware ‘RealRobot’
[ros2_control_node-3] terminate called after throwing an instance of ‘pluginlib::LibraryLoadException’
[ros2_control_node-3] what(): According to the loaded plugin descriptions the class diffdrive_arduino/DiffDriveArduinoHardware with base class type hardware_interface::SystemInterface does not exist. Declared types are diffdrive_arduino/DiffDriveArduino fake_components/GenericSystem fake_robot/FakeRobot mock_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem

2 replies