Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Galactic/Humble #1

Open
peterheim1 opened this issue Dec 6, 2022 · 21 comments
Open

Upgrade to Galactic/Humble #1

peterheim1 opened this issue Dec 6, 2022 · 21 comments

Comments

@peterheim1
Copy link

Hi
this works fine in foxy but not in galactic would it be possible to upgrade it to galactic

@joshnewans joshnewans changed the title Upgrade to Galactic Upgrade to Galactic/Humble Dec 11, 2022
@joshnewans
Copy link
Owner

Hi Peter, as galactic is EOL, my current plan is to update it to humble, and if that happens to be backward compatible with galactic then great, if not I probably won't worry.

I don't have a plan for when I will be doing that just yet, probably some time early next year.

In the meantime if someone wants to submit a PR I'd be happy to accept it. I doubt it would take more than a couple of hours, I just haven't had the time to sit down and do it.

I'll leave this issue up and change the title to reflect that.

Thanks for flagging it!

@Buzzology
Copy link

Hey @peterheim1 , I had a bit of a stab at this for Galactic: #2. It seems to be working for me, but I do not know c++ (or engineering) so definitely worth double checking it.

@winicon001
Copy link

hi Josh, is this hardware interface (diffdrive_arduino) now updated and compatible with humble? I get errors when I attempted to build it. Please let me know. Thanks

@winicon001
Copy link

winicon001 commented Aug 2, 2024

Hi Josh, this is the error I got in case there is something I'm doing wrong:

ROS Version = ROS2 Humble
Linux Version: Ubuntu Mate 22.04


--- stderr: diffdrive_arduino
In file included from /home/winicon/smilebot_ws/src/diffdrive_arduino/src/fake_robot.cpp:1:
/home/winicon/smilebot_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.
In file included from /home/winicon/smilebot_ws/src/diffdrive_arduino/src/diffdrive_arduino.cpp:1:
/home/winicon/smilebot_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/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....
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 [36.0s, exited with code 2]

@joshnewans
Copy link
Owner

@winicon001 are you using the humble branch?
I should probably close this now that this branch exists, but it should work fine (although you need to change your xacro a little).

@winicon001
Copy link

Hi Josh. Thanks a lot. I've been using the main branch. I changed to the humble branch and built. Although I had the error on the serial driver at first:


Finished <<< my-test-package [9.13s]
--- stderr: diffdrive_arduino
In file included from /home/winicon/smilebot_ws/src/diffdrive_arduino/hardware/include/diffdrive_arduino/diffbot_system.hpp:34,
from /home/winicon/smilebot_ws/src/diffdrive_arduino/hardware/diffbot_system.cpp:15:
/home/winicon/smilebot_ws/src/diffdrive_arduino/hardware/include/diffdrive_arduino/arduino_comms.hpp:7:10: fatal error: libserial/SerialPort.h: No such file or directory
7 | #include <libserial/SerialPort.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/diffdrive_arduino.dir/build.make:76: CMakeFiles/diffdrive_arduino.dir/hardware/diffbot_system.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/diffdrive_arduino.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Failed <<< diffdrive_arduino [9.99s, exited with code 2]
Aborted <<< serial_motor_demo [4.01s]


then I went through your instructions where you mentioned the need to install libserial-dev. Then built afterwards and no fatal error;

@winicon001
Copy link

winicon001 commented Aug 3, 2024

@winicon001 are you using the humble branch? I should probably close this now that this branch exists, but it should work fine (although you need to change your xacro a little).

besides, which part of the .xacro am I to change

@winicon001
Copy link

hi josh please I still have challenge running the it. it fails to start the controller manager and couple of things. I'll appreciate if you may clarify what you meant by I still need to change my xacro a little. thank you.

@joshnewans
Copy link
Owner

Here is the example xacro from the humble branch https://github.com/joshnewans/diffdrive_arduino/blob/humble/description/ros2_control/diffbot.ros2_control.xacro

@winicon001
Copy link

Thanks Josh....I'll give it a go shortly and let you know.....much appreciated.

@winicon001
Copy link

winicon001 commented Aug 6, 2024

Here is the example xacro from the humble branch https://github.com/joshnewans/diffdrive_arduino/blob/humble/description/ros2_control/diffbot.ros2_control.xacro

Hi Josh,
sorry, but this is what I got.


winicon@iconrobot2:/smilebot_ws$ ros2 launch my_bot launch_smilebot.launch.py
[INFO] [launch]: All log files can be found below /home/winicon/.ros/log/2024-08-06-07-36-16-005497-iconrobot2-3493
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [3506]
[robot_state_publisher-1] [INFO] [1722926176.820544962] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1722926176.820842715] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1722926176.820888992] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1722926176.820920584] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1722926176.820946824] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1722926176.820971768] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1722926176.820996249] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1722926176.821019823] [robot_state_publisher]: got segment right_wheel
[INFO] [ros2_control_node-2]: process started with pid [3569]
[INFO] [spawner-3]: process started with pid [3571]
[INFO] [spawner-4]: process started with pid [3573]
[ros2_control_node-2] [INFO] [1722926189.185482849] [controller_manager]: Subscribing to '
/robot_description' topic for robot description file.
[ros2_control_node-2] [INFO] [1722926189.189201019] [controller_manager]: update rate is 30 Hz
[ros2_control_node-2] [INFO] [1722926189.191081353] [controller_manager]: RT kernel is recommended for better performance
[spawner-3] [INFO] [1722926192.436721331] [spawner_joint_broad]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1722926192.444910970] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-3] [INFO] [1722926194.497660381] [spawner_joint_broad]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1722926194.499755045] [spawner_diff_cont]: Waiting for '/controller_manager' services to be available
[spawner-3] [INFO] [1722926196.559707547] [spawner_joint_broad]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1722926196.559683232] [spawner_diff_cont]: Waiting for '/controller_manager' services to be available
[spawner-3] [INFO] [1722926198.624244171] [spawner_joint_broad]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1722926198.624308114] [spawner_diff_cont]: Waiting for '/controller_manager' services to be available
[spawner-3] [ERROR] [1722926200.479468475] [spawner_joint_broad]: Controller manager not available
[spawner-4] [ERROR] [1722926200.479469642] [spawner_diff_cont]: Controller manager not available
[ERROR] [spawner-3]: process has died [pid 3571, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_broad --ros-args'].
[ERROR] [spawner-4]: process has died [pid 3573, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diff_cont --ros-args'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[robot_state_publisher-1] [INFO] [1722926308.840169470] [rclcpp]: signal_handler(signum=2)
[ros2_control_node-2] [INFO] [1722926308.840169359] [rclcpp]: signal_handler(signum=2)
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 3506]
[INFO] [ros2_control_node-2]: process has finished cleanly [pid 3569]


When I ran the launch file in the diffdrive_arduino package following the video on adding any HardWare https://www.youtube.com/watch?v=J02jEKawE5U&feature=youtu.be,

This is what I get:


ros2 launch diffdrive_arduino diffbot.launch.py
[INFO] [launch]: All log files can be found below /home/winicon/.ros/log/2024-08-06-07-38-45-882040-iconrobot2-3768
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [3783]
[INFO] [robot_state_publisher-2]: process started with pid [3785]
[INFO] [spawner-3]: process started with pid [3787]
[robot_state_publisher-2] [WARN] [1722926327.446332837] [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] [1722926327.446639460] [robot_state_publisher]: got segment base_link
[robot_state_publisher-2] [INFO] [1722926327.446819475] [robot_state_publisher]: got segment caster_frontal_wheel
[robot_state_publisher-2] [INFO] [1722926327.446861493] [robot_state_publisher]: got segment caster_rear_wheel
[robot_state_publisher-2] [INFO] [1722926327.446893363] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-2] [INFO] [1722926327.446923084] [robot_state_publisher]: got segment right_wheel
[ros2_control_node-1] [WARN] [1722926327.498507652] [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-1] [INFO] [1722926327.499174750] [resource_manager]: Loading hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1722926327.516684298] [resource_manager]: Initialize hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1722926327.517500597] [resource_manager]: Successful initialization of hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1722926327.517992642] [resource_manager]: 'configure' hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1722926327.518098085] [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):
[ros2_control_node-1] #21 Object "/usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1", at 0xffffffffffffffff, in
[ros2_control_node-1] #20 Object "/opt/ros/humble/lib/controller_manager/ros2_control_node", at 0xaaaac1ff2c6f, in
[ros2_control_node-1] #19 Source "../csu/libc-start.c", line 392, in __libc_start_main_impl [0xffffa96874cb]
[ros2_control_node-1] #18 Source "../sysdeps/nptl/libc_start_call_main.h", line 58, in __aarch64_ldadd4_acq [0xffffa96873fb]
[ros2_control_node-1] #17 Object "/opt/ros/humble/lib/controller_manager/ros2_control_node", at 0xaaaac1ff2767, in
[ros2_control_node-1] #16 Object "/opt/ros/humble/lib/libcontroller_manager.so", at 0xffffa9d324cb, 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-1] #15 Object "/opt/ros/humble/lib/libcontroller_manager.so", at 0xffffa9d2eab7, in controller_manager::ControllerManager::init_resource_manager(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)
[ros2_control_node-1] #14 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0xffffa94fbc0b, 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 0xffffa94f92cb, in bool hardware_interface::ResourceStorage::set_component_state<hardware_interface::System>(hardware_interface::System&, rclcpp_lifecycle::State const&)
[ros2_control_node-1] #12 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0xffffa95084fb, in
[ros2_control_node-1] #11 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0xffffa951a5cf, in
[ros2_control_node-1] #10 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0xffffa9519adf, in hardware_interface::System::configure()
[ros2_control_node-1] #9 Object "/home/winicon/smilebot_ws/install/diffdrive_arduino/lib/libdiffdrive_arduino.so", at 0xffffa20970bf, in diffdrive_arduino::DiffDriveArduinoHardware::on_configure(rclcpp_lifecycle::State const&)
[ros2_control_node-1] #8 Object "/home/winicon/smilebot_ws/install/diffdrive_arduino/lib/libdiffdrive_arduino.so", at 0xffffa209952f, in ArduinoComms::connect(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int)
[ros2_control_node-1] #7 Object "/usr/lib/aarch64-linux-gnu/libserial.so.1.0.0", at 0xffffa201842b, in
[ros2_control_node-1] #6 Object "/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30", at 0xffffa98e2e03, in __cxa_throw
[ros2_control_node-1] #5 Object "/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30", at 0xffffa98e2b1f, in std::terminate()
[ros2_control_node-1] #4 Object "/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30", at 0xffffa98e2abb, in
[ros2_control_node-1] #3 Object "/usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30", at 0xffffa98e62db, in __gnu_cxx::__verbose_terminate_handler()
[ros2_control_node-1] #2 Source "./stdlib/abort.c", line 79, in abort [0xffffa968712f]
[ros2_control_node-1] #1 Source "../sysdeps/posix/raise.c", line 26, in raise [0xffffa969a67b]
[ros2_control_node-1] #0 Source "./nptl/pthread_kill.c", line 44, in __pthread_kill_implementation [0xffffa96df200]
[ros2_control_node-1] Aborted (Signal sent by tkill() 3783 1000)
[ERROR] [ros2_control_node-1]: process has died [pid 3783, exit code -6, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_9e4vckhp --params-file /home/winicon/smilebot_ws/install/diffdrive_arduino/share/diffdrive_arduino/config/diffbot_controllers.yaml'].
[spawner-3] [INFO] [1722926330.998404730] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-3] [INFO] [1722926333.056564245] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-3] [INFO] [1722926335.102136301] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-3] [INFO] [1722926337.155703795] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' node to exist
[spawner-3] [ERROR] [1722926339.011003833] [spawner_joint_state_broadcaster]: Controller manager not available
[ERROR] [spawner-3]: process has died [pid 3787, 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 [3901]
[INFO] [rviz2-5]: process started with pid [3903]
[rviz2-5] qt.qpa.xcb: could not connect to display
[rviz2-5] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
[rviz2-5] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
[rviz2-5]
[rviz2-5] Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
[rviz2-5]
[ERROR] [rviz2-5]: process has died [pid 3903, exit code -6, cmd '/opt/ros/humble/lib/rviz2/rviz2 -d /home/winicon/smilebot_ws/install/diffdrive_arduino/share/diffdrive_arduino/rviz/diffbot.rviz --ros-args -r __node:=rviz2'].
[spawner-4] [INFO] [1722926342.577283051] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1722926344.638705261] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1722926346.700997233] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1722926348.760068698] [spawner_diffbot_base_controller]: Waiting for '/controller_manager' node to exist
[spawner-4] [ERROR] [1722926350.614732254] [spawner_diffbot_base_controller]: Controller manager not available
[ERROR] [spawner-4]: process has died [pid 3901, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diffbot_base_controller --controller-manager /controller_manager --ros-args'].


Please see what you could do...

here is the link to my code: https://github.com/winicon001/my_bot.git
here is the link to the diffdrive_arduino fork of yours: https://github.com/winicon001/diffdrive_arduino.git

Thanks a lot.

@winicon001
Copy link

Hi Josh, Please were you able to assist to have a look? I'll really appreciate if you could assist to point me where I might be missing a detail. The controller manager seems not running. At this point I seem clueless about how to navigate the files further. Any help would be highly appreciated.. Thank you.

@joshnewans
Copy link
Owner

Hi I think it might be a problem I have seen before myself and not worked out a solution for.

I've got a bit going on at the moment and probably won't get a chance to look into it for a couple of months, but if you do manage to figure it out please share here so we can all learn :)

@winicon001
Copy link

winicon001 commented Aug 8, 2024 via email

@joshnewans
Copy link
Owner

Actually it looks like a slightly different issue to what I thought.

One thing to check - your serial port https://github.com/winicon001/my_bot/blob/9284445cd9cb8ede0d8bf035cf527784451058ce/description/ros2_control.xacro#L11 looks awfully similar to my one - make sure you change it to point to whatever is correct for your arduino.

@winicon001
Copy link

winicon001 commented Aug 8, 2024 via email

@joshnewans
Copy link
Owner

My only suggestion would be to try and get the diffdrive_arduino example working again (without the rest of my_bot) because that error looks easier to chase down. It seems to be the serial failing to open the port (rather than the other one which is the controller_manager not starting).

The error I have been seeing lately is the controller manager not starting when it's in simulation but working fine for the real robot (and in that case you can get around it by swapping to the old Gazebo controller).

@winicon001
Copy link

In fact Josh, something strange happened.... when I tried something differet....Please see below for the steps


I ran this On Dev machine

ros2 launch my_bot launch_sim.launch.py world:=/robot_ws/src/my_bot/worlds/cafe.world

I ran this on the Robot Raspi

ros2 launch diffdrive_arduino diffbot.launch.py # Ran the I stopped it

Then ran this on the Robot

ros2 launch my_bot launch_smilebot.launch.py

#####Response from Robot Terminal#############

[INFO] [launch]: All log files can be found below /home/winicon/.ros/log/2024-08-04-14-54-23-513554-iconrobot2-342004
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [342064]
[robot_state_publisher-1] [INFO] [1722779664.426200618] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1722779664.426534227] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-1] [INFO] [1722779664.426607486] [robot_state_publisher]: got segment camera_link_optical
[robot_state_publisher-1] [INFO] [1722779664.426642005] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1722779664.426668875] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1722779664.426695615] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1722779664.426721115] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1722779664.426746134] [robot_state_publisher]: got segment right_wheel
[INFO] [ros2_control_node-2]: process started with pid [342392]
[INFO] [spawner-3]: process started with pid [342394]
[INFO] [spawner-4]: process started with pid [342396]
[ros2_control_node-2] [INFO] [1722779676.844041828] [controller_manager]: Subscribing to '~/robot_description' topic for robot description file.
[ros2_control_node-2] [INFO] [1722779676.850475868] [controller_manager]: update rate is 30 Hz
[ros2_control_node-2] [INFO] [1722779676.853035133] [controller_manager]: RT kernel is recommended for better performance
[spawner-3] [INFO] [1722779680.109189150] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-4] [INFO] [1722779680.428972774] [spawner_diff_cont]: Waiting for '/controller_manager' services to be available
[spawner-3] [INFO] [1722779682.159329284] [spawner_joint_broad]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1722779682.482359373] [spawner_diff_cont]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1722779686.270153660] [spawner_diff_cont]: Loaded diff_cont
[spawner-3] [INFO] [1722779688.746071416] [spawner_joint_broad]: Loaded joint_broad
[spawner-4] [INFO] [1722779690.210305203] [spawner_diff_cont]: Configured and activated diff_cont
[spawner-3] [INFO] [1722779690.427956009] [spawner_joint_broad]: Configured and activated joint_broad
[INFO] [spawner-4]: process has finished cleanly [pid 342396]
[INFO] [spawner-3]: process has finished cleanly [pid 342394]


This proves to me that I havent mapped the files correctly for the controller manager to run, but I dont just have a clue where I'm missing it out....

How I wish I could have an online call with you so I could show you. All I need is 30minutes and my life will never be the same again.... :)

@joshnewans
Copy link
Owner

Yes so I am interested in that second one (diffdrive_arduino diffbot.launch.py) and what its output is.

And yes you and a hundred other people! Unfortunately I don't have the time for one-on-one support (as I only do this YouTube stuff in my spare time outside my engineering day job) so I try to spend that limited time doing things that can reach the most people - like videos.

@winicon001
Copy link

winicon001 commented Aug 8, 2024 via email

@winicon001
Copy link

winicon001 commented Aug 8, 2024

Hi Josh!!!

I changed the serial to tty/USB0 and it gave a different output!!. Please see below:


winicon@iconrobot2:/smilebot_ws$ ros2 launch diffdrive_arduino diffbot.launch.py
[INFO] [launch]: All log files can be found below /home/winicon/.ros/log/2024-08-09-00-37-42-843622-iconrobot2-15804
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [15834]
[INFO] [robot_state_publisher-2]: process started with pid [15836]
[INFO] [spawner-3]: process started with pid [15838]
[robot_state_publisher-2] [WARN] [1723160265.748359935] [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] [1723160265.748692008] [robot_state_publisher]: got segment base_link
[robot_state_publisher-2] [INFO] [1723160265.748923118] [robot_state_publisher]: got segment caster_frontal_wheel
[robot_state_publisher-2] [INFO] [1723160265.748973210] [robot_state_publisher]: got segment caster_rear_wheel
[robot_state_publisher-2] [INFO] [1723160265.749006247] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-2] [INFO] [1723160265.749034340] [robot_state_publisher]: got segment right_wheel
[ros2_control_node-1] [WARN] [1723160265.824727897] [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-1] [INFO] [1723160265.830672284] [resource_manager]: Loading hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1723160265.835891507] [resource_manager]: Initialize hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1723160265.837289780] [resource_manager]: Successful initialization of hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1723160265.838398573] [resource_manager]: 'configure' hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1723160265.838716572] [DiffDriveArduinoHardware]: Configuring ...please wait...
[ros2_control_node-1] [INFO] [1723160265.884267454] [DiffDriveArduinoHardware]: Successfully configured!
[ros2_control_node-1] [INFO] [1723160265.884393750] [resource_manager]: Successful 'configure' of hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1723160265.884429601] [resource_manager]: 'activate' hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1723160265.884453712] [DiffDriveArduinoHardware]: Activating ...please wait...
[ros2_control_node-1] The ReadByte() call has timed out.
[ros2_control_node-1] [INFO] [1723160266.885945951] [DiffDriveArduinoHardware]: Successfully activated!
[ros2_control_node-1] [INFO] [1723160266.886056932] [resource_manager]: Successful 'activate' of hardware 'DiffBot'
[ros2_control_node-1] [INFO] [1723160266.966657287] [controller_manager]: update rate is 10 Hz
[ros2_control_node-1] [INFO] [1723160266.969639277] [controller_manager]: RT kernel is recommended for better performance
[ros2_control_node-1] The ReadByte() call has timed out.
[ros2_control_node-1] [INFO] [1723160269.403292866] [controller_manager]: Loading controller 'joint_state_broadcaster'
[spawner-3] [INFO] [1723160269.482179319] [spawner_joint_state_broadcaster]: Loaded joint_state_broadcaster
[ros2_control_node-1] [INFO] [1723160269.487084154] [controller_manager]: Configuring controller 'joint_state_broadcaster'
[ros2_control_node-1] [INFO] [1723160269.487546449] [joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[spawner-3] [INFO] [1723160269.778851566] [spawner_joint_state_broadcaster]: Configured and activated joint_state_broadcaster
[INFO] [spawner-3]: process has finished cleanly [pid 15838]
[INFO] [spawner-4]: process started with pid [15900]
[INFO] [rviz2-5]: process started with pid [15902]
[rviz2-5] qt.qpa.xcb: could not connect to display
[rviz2-5] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
[rviz2-5] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
[rviz2-5]
[rviz2-5] Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
[rviz2-5]
[ERROR] [rviz2-5]: process has died [pid 15902, exit code -6, cmd '/opt/ros/humble/lib/rviz2/rviz2 -d /home/winicon/smilebot_ws/install/diffdrive_arduino/share/diffdrive_arduino/rviz/diffbot.rviz --ros-args -r __node:=rviz2'].
[ros2_control_node-1] [INFO] [1723160272.353330430] [controller_manager]: Loading controller 'diffbot_base_controller'
[spawner-4] [INFO] [1723160272.479275536] [spawner_diffbot_base_controller]: Loaded diffbot_base_controller
[ros2_control_node-1] [INFO] [1723160272.488464949] [controller_manager]: Configuring controller 'diffbot_base_controller'
[spawner-4] [INFO] [1723160272.778690233] [spawner_diffbot_base_controller]: Configured and activated diffbot_base_controller
[INFO] [spawner-4]: process has finished cleanly [pid 15900]


Script I used: ros2 launch diffdrive_arduino diffbot.launch.py

Hardware Interface:

<xacro:macro name="diffbot_ros2_control" params="name prefix">

<ros2_control name="${name}" 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">3436</param>
    <param name="pid_p">20</param>
    <param name="pid_d">12</param>
    <param name="pid_i">0</param>
    <param name="pid_o">50</param>
  </hardware>
  <joint name="${prefix}left_wheel_joint">
    <command_interface name="velocity"/>
    <state_interface name="position"/>
    <state_interface name="velocity"/>
  </joint>
  <joint name="${prefix}right_wheel_joint">
    <command_interface name="velocity"/>
    <state_interface name="position"/>
    <state_interface name="velocity"/>
  </joint>
</ros2_control>

</xacro:macro>


Hopefully this sorts it.....

I'll keep you posted on my trials and errors :)

Thanks Prof*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants