Skip to content

Instantly share code, notes, and snippets.

@MatheusR42
Last active May 11, 2020 04:50
Show Gist options
  • Save MatheusR42/2c0e19fb27bdf5760b92cc349a9e118b to your computer and use it in GitHub Desktop.
Save MatheusR42/2c0e19fb27bdf5760b92cc349a9e118b to your computer and use it in GitHub Desktop.
Commands from Ros Essentials Udemy Course (https://www.udemy.com/course/ros-essentials)

ROS

Creating workspace

mkdir -p ~/catkin_ws/src && cd ~/catkin_ws

Go to ROS workspace

roscd

Create a package

catkin_create_pkg <package-name> <dependencies-names>

Build

In the root directory run:

catkin_make

Commands

Init core components necessary to nodes communication

roscore

List nodes (micro components off project)

rosnode list

List Topics (open communication channels. Publications and Subscriptions)

rostopic list

rostopic info <topic-name>

rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 2.0]'

rosnode info <node-name>

rosnode echo <publication-name>

rosrun rqt_graph rqt_graph

rosmsg show turtlesim/Pose

Services

Client send a request message to the server, server process this message and send a response message and close.

rosservices lists

rosservice info <service-name>

rossrv info <service-type>

rosservice call <service-name> <service-args>

rossrv list

rossrv show <package-name/service-name>

rossrv show <service-name>

Difference between rossrv and rosserice:

https://answers.ros.org/question/349148/rossrv-vs-rosservice/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment