- ROS Cheat Sheet
- Workspaces
- Packages
- Running System
- Developer Commands
- Setting up your environment
- Bags
- Tips
Command |
Action |
Example usage and subcommand examples |
---|---|---|
|
A tool inspecting packages/stacks. |
|
|
Changes directories to a package or stack. |
|
|
Lists package or stack information. |
|
|
Creates a new ROS package. |
|
|
Creates a new ROS stack. |
|
|
Installs ROS package system dependencies. |
|
|
Builds a ROS package. |
|
|
Displays a errors and warnings about a running ROS system or launch file. |
|
|
Displays package structure and dependencies. |
|
|
It allows you to directly edit a file within a package by package name rather than having to know the package path. |
Usage:
Example:
|
Command |
Action |
Example usage and subcommand examples |
---|---|---|
|
This is a set of tools for recording from and playing back to ROS topics. |
Record all topics: Record select topics: |
|
will take the contents of one or more bagfile, and play them back in a time-synchronized fashion. |
Replay all messages without waiting: Replay several bag files at once: |
Command |
Action |
Example usage and subcommand examples |
---|---|---|
|
Displays a graph of the ROS nodes that are currently running,as well as the ROS topics that connect them. |
|
|
A tool for plotting data from one or more ROS topic fields using matplotlib. |
To graph the data in different plots: To graph the data all on the same plot: To graph multiple fields of a message: |
|
A tool for visualizing, inspecting, and replaying histories (bag files) of ROS messages. |
|
|
A tool for displaying and filtering messages published on rosout. |
|
mkdir catkin_ws
cd catkin_ws
wstool init src
catkin_make
source devel/setup.bash
Source space (/src)
: contains the source code of catkin packages. Subfolder of this are the ROS packages you want to add to your system. All your stuff goes here!
Build space (/build)
: space where cmake is invoked to build the catkin packages cmake and catkin keep their cache information and other intermediate files here. Not where catkin_make is invoked!
Devel space (/devel)
: Space where built targets are placed prior to being installed
roscd
cd ../src
wstool set repo_name --git http://github.com/org/repo_name.git --version=indigo-devel
wstool up
sudo rosdep init # only once
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=indigo -y
catkin_create_pkg package_name [dependencies ...]
include/package_name # C++ header files
src # Source files, Python libraries in subdirectories
scripts # Python nodes and scripts
msg, srv, action # Message, Service, and Action definitions
catkin_generate_changelog
# review & commit changelogs"
catkin_prepare_release
bloom-release --track indigo --ros-distro indigo repo_name
roscore
roslaunch my_package package_launchfile.launch
rosnode list
rostopic list
rostopic echo cmd_vel
rostopic hz cmd_vel
rostopic info cmd_vel
rosmsg show geometry_msgs/Twist
export ROS_IP or ROS_HOSTNAME #set to this machine’s network address
export ROS_MASTER_URI #set to URI containing that IP or hostname
export ROS_IP or ROS_HOSTNAME #set to your machine’s network address
export ROS_MASTER_URI #set to the URI from the master
To debug, check ping from each side to the other, run roswtf on each side
vi $HOME/.ros/config/rosconsole.config log4j.logger.ros.package_name=DEBUG
Adjust using rqt_logger_level and monitor via rqt_console. Use the roslaunch --screen flag to force all node output to the screen, as if each declared had the output="screen" attribute.
Name | Purpose |
---|---|
catkin_make |
Build all projects in workspace. Run from root folder. Example: ~/catkin_ws/ . |
catkin_make clean |
Clean all projects in workspace. Run from root folder. Example: ~/catkin_ws/ . |
Set the address of the robot.
export ROS_MASTER_URI=http://<robot ip>:11311/
Should be set to the PC you are as the workstation.
export ROS_HOSTNAME=<workstation IP>
Para crear un bag que salve todos los mensajes
rosbag record [-O bag_file] -a
Para salvar unos topics en particular:
rosbag record [-O bag_file] [topic_name1] [topic_name2] ...
La grabación se termina cuando se pulsa ctrl-c
Pasar de .bag.active a .bag
rosbag reindex *.bag.active
rosbag fix *.bag.active new_name.bag
Cierre seguro del rosbag
rosnode kill /vt/rosbag/record
$ rostopic find sensor_msgs/String // you want to find all the topics of a certain message type
More info: http://wiki.ros.org/ROS/CommandLineTools
ROS2: https://osrf.github.io/ros2multirobotbook/intro.html
ROS1 & NodeJs: http://wiki.ros.org/rosnodejs
📝 Note: Cuando corremos un comando
echo -c
, el topico se mostrara sin salto de linea
Copyright © 2022 carjavi.
www.instintodigital.net
[email protected]