JetsonHacks

Developing on NVIDIA® Jetson™ for AI on the Edge

Exploring ROS – RACECAR/J

Exploring ROS is easy using the both the built-in tools and additional GUI based tools. Looky here:

This is a little different than most the content on JetsonHacks. Basically we bring up a running ROS system using the MIT RACECAR stack and take a look around. This gives some background on how to use the ROS introspection tools. There are several ways to gather the same information, using both graphics based tools and command line tools. In the video, we mix these up a bit so that you can get a feel on how to explore on your own.

To be clear, PLAY! A lot of people ask “How do I do this?” or “I want to do this, what should I do?”. These types of projects are not about some rote method of “Do this, do that”. Get in there, take things apart, put things together! Look around, play and see what happens. You will need to understand how all this works and ties together, and the only way to do that is to get your hands dirty.

Many people ask us questions such as “How do I do this?” You will always receive the reply, “What did you try?” If you haven’t tried anything, you don’t have a foundation from which to ask a question. Therefore we can’t help you. On the other hand, if you say “I tried this, that and the other thing and it didn’t work”, there’s a starting point on which to build. Plus, you’re smart enough to figure most of this out on your own, you don’t need help.

Same thing with general questions. If a simple one sentence question requires a PhD dissertation as an answer, you should consider breaking the question into something just a little more specific.

Background

Because of the format of the video which is an interactive exploration of the RACECAR stack, we’ll just have some notes here. You should definitely have the book “Programming Robots with ROS, a practical introduction to the Robot Operating System” by Morgan Quigley, Brian Gerkey and William D. Smart. The book is written by the people who wrote ROS originally, and has a very good overview of ROS and practical application.

Notes

rqt is a Qt-based framework for GUI development for ROS. It consists of three parts/metapackages:

In the video, we load rqt:

$ sudo apt-get install ros-kinetic-rqt -y
$ sudo apt-get install ros-kinetic-rqt-common-plugins -y
$ sudo apt-get install ros-kinetic-rqt-robot-plugins -y

You should know that most of the command line tools shown in the video have equivalents in the rqt system. Again, Play! There is so much more than can be covered in a few minutes of video. We chose to use command line tools in addition to rqt so that you would be exposed to both ways of doing the same tasks. It is easier to see the full graph of the system in rqt, it’s easier to see the messages using the command line.

We use several command line tools:

These are specific tools, and are useful. There is a very rich environment of documentation and examples, both on the ROS Wiki and elsewhere. Please use those resources to become familiar with the concepts in use here.

One thing we didn’t cover in the video is the mechanism which ROS uses to communicate between nodes. We know that ROS topics provide access to ROS messages.

ROS is pretty simple conceptually, but as in most distributed systems it can turn in to a tangle when you try to examine it. There is roscore, which is the minimum number of ROS nodes and the server which constitute the ROS “kernel” if you will. The server is “ROS MASTER” (you may recall this from setting up ROS). ROS Master conceptually keeps track of all the nodes. When a node registers a publish/subscribe request, it looks up corresponding nodes which are interested in that information based on the rostopic the node wants to use. ROS Master also communicates with a parameter server to inform nodes of how messages are constructed.

ROS Master has other responsibilities of course, but it’s useful to know at least that it is responsible for the lower level communication.

Conclusion

This is the first part of an occasional series of post of hands on with the RACECAR ROS stack. We are planning more in the future, stay tuned!

Facebook
Twitter
LinkedIn
Reddit
Email
Print

6 Responses

      1. joy_node is the ROS driver for the generic Linux joystick. It is not part of the source code for the MIT RACECAR stack. Try this:
        Google the term joy_node
        The first entry is “joy – ROS Wiki” http://wiki.ros.org/joy
        That is the documentation for joy_node; The source code is on Github: https://github.com/ros-drivers/joystick_drivers

        It’s more difficult to figure out how it got loaded in the first place. However, you probably know that there is a racecar.rosinstall file which lists src/racecar as one of the packages to load from Github. When the racecar package is loaded there is a file for the package dependencies located in racecar/racecar/package.xml. You will see a line

        <run_depend>joy</run_depend>

        Because the joy package is an existing package in the apt-get system, it doesn’t need to be compiled and is directly loaded from the apt-get system. Thus it appears that joy gets loaded automagically, when in fact it just gets loaded from the apt-get repositories.

        Hope this helps

        1. Hi,
          Thank you for the info. One last question, While running rostopic echo on joy_teleop, Ackermann_cmd_input and Ackermann_cmd there is no difference in output. Also, the ROS wiki doesn’t mention the subscribed topics for Ackermann_cmd and the racecar_safety_controller has a script file which basically subscribes to Ackermann_cmd_input and publishes on Ackermann_cmd. So when I try to subscribe directly to joy_teleop in Ackermann_to_vesc.cpp it doesn’t work. I tried to dig into ros wiki but didn’t find the solution, Can you help me understand this?

          1. There are several questions there. I don’t understand them. joy_teleop is a rosnode, I don’t know what it means to subscribe to it (you subscribe to ros topics), or rostopic echo it. I don’t know what the topic Ackermann_cmd_input is.

            To be clear, if you’re looking for answers here you will receive the standard “go out and play!” and “read the book!”
            You should get the book mentioned and go through it. There is a steep learning curve (though not much of it is difficult, there’s just a large volume of material and wrapping your head around distributed processing).

Leave a Reply

Your email address will not be published. Required fields are marked *

Disclaimer

Some links here are affiliate links. If you purchase through these links I will receive a small commission at no additional cost to you. As an Amazon Associate, I earn from qualifying purchases.

Books, Ideas & Other Curiosities