Research

icon picker
ROS2 Research

ros2

The ros2 tool is how the user manages, introspects, and interacts with a ROS system. It supports multiple commands that target different aspects of the system and its operation. One might use it to start a node, set a parameter, listen to a topic, and many more. The ros2 tool is part of the core ROS 2 installation.

RQt is a graphical user interface framework that implements various tools and interfaces in the form of plugins. One can run all the existing GUI tools as dockable windows within RQt! The tools can still run in a traditional standalone method, but RQt makes it easier to manage all the various windows in a single screen layout.

Using rqt tools for analysis

rqt_graph - view node interaction
image.png
rqt_console
image.png
View ros logs with cool video timeline
image.png
Image view
rqt_plot: view data plots
image.png

A dashboard is a single rqt window with one or more plugins displayed in movable, resizable frames. Dashboards generally consist of a number of plugins that in combination provide a suite of UI capabilities for working with robots and robot data.
image.png

ros2 node list

ros2 node list will show you the names of all running nodes. This is especially useful when you want to interact with a node, or when you have a system running many nodes and need to keep track of them.

ros2 node info

ros2 node info returns a list of subscribers, publishers, services, and actions. i.e. the ROS graph connections that interact with that node. The output should look like this:
Action Servers: /turtle1/rotate_absolute: turtlesim/action/RotateAbsolute Action Clients:


Understanding nodes

Each node in ROS should be responsible for a single, modular purpose, e.g. controlling the wheel motors or publishing the sensor data from a laser range-finder. Each node can send and receive data from other nodes via topics, services, actions, or parameters.
In ROS 2, a single executable (C++ program, Python program, etc.) can contain one or more nodes.
Loading…
View of ROS2 Nodes in Our System
1

Dependencies

rosdep

rosdep is ROS’s dependency management utility that can work with ROS packages and external libraries. rosdep is a command-line utility for identifying and installing dependencies to build or install a package.
It has the ability to work over a single package or over a directory of packages (e.g. workspace).

package.xml files

A package’s package.xml file contains a set of dependencies. The dependencies in this file are generally referred to as “rosdep keys”. These are represented in the tags <depend>, <test_depend>, <exec_depend>, <build_depend>, and <build_export_depend>. They specify in what situation each of the dependencies are required in.
For mixed purposes, use depend, which covers build, export, and execution time dependencies.
These dependencies are manually populated in the package.xml file by the package’s creators and should be an exhaustive list of any non-builtin libraries and packages it requires.

How does rosdep work?

rosdep will check for package.xml files in its path or for a specific package and find the rosdep keys stored within. These keys are then cross-referenced against a central index to find the appropriate ROS package or software library in various package managers. Finally, once the packages are found, they are installed and ready to go!

How to know which keys to put in the package.xml


For ROS packages (e.g. nav2_bt_navigator), you may simply place the name of the package. The central index is known as rosdistro, which . You can find a list of all released ROS packages in rosdistro at <distro>/distribution.yaml for your given ROS distribution.
To find a key, search for your library in this file and find the name in yaml that contains it. This is the key to put in a package.xml file.
mm

Now that we have some understanding of rosdep, package.xml, and rosdistro, we’re ready to use the utility itself! Firstly, if this is the first time using rosdep, it must be initialized via:
This will initialize rosdep and update will update the locally cached rosdistro index. It is a good idea to update rosdep on occasion to get the latest index.
Finally, we can run rosdep install to install dependencies. Typically, this is run over a workspace with many packages in a single call to install all dependencies. A call for that would appear as the following, if in the root of the workspace with directory src containing source code.
Breaking that down:
--from-paths src specifies the path to check for package.xml files to resolve keys for
-y means to default yes to all prompts from the package manager to install without prompts
--ignore-src means to ignore installing dependencies, even if a rosdep key exists, if the package itself is also in the workspace.
There are additional arguments and options available. Use rosdep -h to see them.

Install these ROS2 packages to /src:


Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.