Main video
Extra video
Main video blog post
Extra video blog post
This is the discussion topic for the video and blog post linked above. Please keep all replies relevant to the content, otherwise create a new topic.
Main video
Extra video
Main video blog post
Extra video blog post
This is the discussion topic for the video and blog post linked above. Please keep all replies relevant to the content, otherwise create a new topic.
Hi Josh just watched the videos you posted dropped for module number 12. Iām getting really excited as I see all of this coming together. Iāve been collecting the bits and pieces to build my own set up and follow your tutorials.
My question has to do with the physical hardware controller that you used it looks like itās a gaming controller of some kind. Iām not very familiar as I donāt have a gaming system or play one.
I realize that ultimately I could use most any gaming controller if I wanna just write my own inner face but for the moment I just wanna duplicate what youāve done and then branch off on my own
Do you have any thoughts or recommendations on a particular one to buy and start with So I can use the exact configuration you are using?
Hey Eric, Iāll be diving deeper into that in 2 videos time, but hereās a few quick points :
joy/joy_node
to read the raw joystick data from the OS and publish it to /joy
.teleop_twist_joy
to take those axis/button press measurements from /joy
and convert them to a Twist
message on /cmd_vel
. The axis/button numbering will be different for different controllers, you just have to set the parameters accordingly (e.g. axis 1 is forward/reverse, axis 2 is left/right, button 4 is enable).Hope that helps!
Josh, thank you. Helpful information. I just purchased the same controller for $13 USD, so I can test what you are doing. I think it is helpful when you post links to what parts you are using so others can follow-along.
-Eric
Josh, Iāve been thinking about an idea for a future tutorial for you, related to robot control. Itās one I would really like to see.
Once you have the ROS2 Control working with your joystick/game controller, I would like to see you add a control node using an Arduino., LCD shield, a few buttons and potentiometers. This would help us see how your Arduino node would do for I/O, say on a custom portable control pendant. Hereās what I have in mind:
INPUTS
2 buttons - Honk Remote buzzer or flash LED headlights.
3 potentiometers - speed control, throttle (and, ideally, steering, perhaps using a dual pot joystick but I understand that is more involved).
OUTPUTS
Buzzer - when a bump switch on robot is activated it should trigger this buzzer/light/whatever
LCD - One line for Speed and heading (relative to anything you can grab); One line for angle of something, like the wheels; and One line for distance to object ā whatever is in front.
What I am really keen to learn is how you would plan this and do the interface to both broadcast and listen to the appropriate pins/signals.
The concepts you develop here, perhaps with input from the community, would allow us to make custom controllers with bidirectional capabilities.
If you do not have an LCD shield, I would be happy to make a contribution to cover one.
I would really like to see this in a future video.
Thanks for all you do to teach and guide us.
Eric
Update: If the above is a task that is better suited for a Raspberry Pi, that is OK. If so, I would like to understand why (e.g. software, IO, libraries, etc. If Raspberry PI, could we use a PICO W with an I2C Shield or something?). This is what I think an excellent concept that people [like me] could run with once they an understanding of how to approach this. Thanks for considering.
Hey Eric, interesting idea!
Are you imagining something like the ones James Bruton has made for his videos?
Heās had a few different ones (at least 3), but the āold oneā shown at the start of this video seems to be what youāre describing.
I had not considered it, but thatās not a bad idea, I will give it further thought. Iād probably be leaning toward the Pico W (as youāve suggested) and programming it with micro-ROS or CircuitPython, but those decisions would mostly be driven by me having never used those platforms before and it seems like a good starter project to get my feet wet.
Yes! I had forgotten about his video. Iāve had the idea in the back of my mind for too many years, but the missing link was the software. You are convincing me that ROS2 is the way to go.
Please do consider the basic proposal in one of your upcoming videos. Happy to help brainstorm.
UPDATE: I just watched the video again. I like his idea of using a touch screen for more virtual buttons. Might be cool someday to touch a map of the room and the robot goes there. Then a PTZ Camera on the robot can beam video back. He uses an Arduino to manage the I/O and send/receive commands via Serial to USB into the Pi, which runs the ROS node. Source code in his github but I think it may be ROS not ROS2.
Hi Josh,
Thanks for share this ros2 control video it is very helpful.
I am getting this error while running āros2 launch my_bot launch_sim.launch.pyā. If you have any suggestions to resolve this issue. kindly pleas share it with me.
[gzserver-2] [ERROR] [1669334236.428722199] [gazebo_ros2_control]: parser error Couldnāt parse params file: āāparams-file /home/niranjan/dev_ws/install/my_bot/share/my_bot/config/my_control_params.yamlā. Error: Cannot have a value before ros__parameters at line 4, at /tmp/binarydeb/ros-foxy-rcl-yaml-param-parser-1.1.14/src/parse.c:623, at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/arguments.c:388
Thanks
Niranjan
Hi Josh,
I think I am able to resolve this issue. It looks like the my_controls.yml parameter file ros__parameters requires two underscore I had a typo here. After fixing the typo the issue got resolved.
Thanks
Niranjan
Glad you were able to get it fixed!
And yes that double underscore is an easy mistake to make, Iāve definitely tripped on that before!
Hi I have a problem guys, after implementing ros2_control , the robot moves in the opposite direction (forward and backwards) in rviz2ā¦ Gazebo is working fine though (except for the publish_rate thingy)ā¦ please any ideas on how to solve this?
Hmm, the first thing Iād say would be to step through and make sure you understand your kinematic chain, i.e. which axes are pointing in which direction. I believe I had Z pointing out, i.e. the left wheel is āpositive-Z-rotation-forwardsā and the right wheel is āpositive-z-rotation-backwardsā.
The axis
of the right wheel joint
is then flipped, and you should be able to check this by not running ros2_control and instead using joint_state_publisher
to manually control the joint angles. Make sure that a positive joint corresponds to the robot moving forward and vice versa.
Then in ros2_control.xacro
and my_controllers.yaml
(or whatever you have called them), ensure that left and right are assigned correctly.
Finally, make sure that your fixed frame is odom
in RViz.
Let me know how you go!
Hello Josh,
After implementing the fix to increase gazebo clock rate, I get the following error message when running gazebo - even though it otherwise seems to be working fine:
...
[gzserver-2] Error [parser.cc:403] Error parsing XML in file [/home/mhered/dev_ws/install/manolobot_uno/share/manolobot_uno/config/gazebo_params.yaml]: Error document empty.
...
If appears it is trying to interpret the gazebo_params.yaml
file as XML and failing.
I noticed also your comment in the blog post:
On my computer I also get an error printed in the Gazebo terminal which is a bit annoying, I think the Gazebo command line parser is treating the file as an extra SDF to load and failing. We can just ignore it, but if youāve got a fix then let me know!
Is this the error you refer to?
I got it fixed. it was the kinematic chain problem. Thank you
So Iāve been fallowing your tutorial for a project. Thank you BTW. Itās been hard to find Raspberry Pi examples.
Problem is. I ran this part of the tutorial last night and it all seemed to work with exception of a type in my config. The robot started doing flips when set to move forward. Anyways I think I got that solved but now, today when I try to run it the controller manager is not loadingā¦ All the sudden itās just not there any more.
Output:
ros2 run controller_manager spawner diff_cont
[INFO] [1679414845.079311127] [spawner_diff_cont]: Waiting for ā/controller_managerā node to exist
[INFO] [1679414847.090650840] [spawner_diff_cont]: Waiting for ā/controller_managerā node to exist
[INFO] [1679414849.100639643] [spawner_diff_cont]: Waiting for ā/controller_managerā node to exist
[INFO] [1679414851.114171358] [spawner_diff_cont]: Waiting for ā/controller_managerā node to exist
[ERROR] [1679414853.122073734] [spawner_diff_cont]: Controller manager not available
Why now? Worked last night. I canāt even list interfacesā¦ Same problem.
Okayā¦ Somehow controller manager mysteriously started working.
Thanks to Niranjan_Rao pointing out the underscore issue, that did make a difference.
But now he is back to doing flips instead of moving forward or reverse. Iām sure Iāll figure it out, obviously a config issue.
HI Josh,
Didnāt find any issues until Ros2_control was introduced.
With gazebo_ros2_control my robot moves only forward and backwards, doesnāt respond the angular velocity command and the /odom frame doesnāt show up in the RVIZ fixed frame selection list.
i have tried it on Foxy and humble. the result is the same.
Any ideas how I can fix this.
Hi Josh,
Your tutorial is very helpful. and i want to use ros_control to control my robot with ackermann type instead of your diff.
You can make a video tutorial. I sincerely thank
Further into the investigation i have noticed the odom TF has the below error.
Error: TF NAN_INPUT: Ignoring transform for child_frame_id ābase_linkā from authority āAuthority undetectableā because of a nan value in the transform (-nan -nan 0.000000) (-nan -nan -nan -nan)
at line 278 in /tmp/binarydeb/ros-foxy-tf2-0.13.14/src/buffer_core.cpp
Error: TF DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id ābase_linkā from authority āAuthority undetectableā because of an invalid quaternion in the transform (-nan -nan -nan -nan)
@JoshNewans Can you please help me out on what causes this error and how to resolve it. This has practically stopped me in continuing further in to this wonderful tutorial.
Iām having the same problem. Everything works except the angular velocity