Source Setup Files
source /opt/ros/<distro>/setup.bash
-> written in .bashrc
mkdir -p catkin_ws/src
cd catkin_ws
catkin init
Using Catkin-Tools instead of catkin_make has many advantages including easier package managing
catkin build
will create devel and build folder
source devel/setup.bash
needs to be run everytime (-> added to .bashrc)
ros + package will the Path to package if found
ros + cd changes your pwd to package directory
ros + ls lists contents of that package
not so important for now Every Package contains build, devel, src Folders
Cmake Workflow:
mkdir build
cd build
cmake ..
make
Nodes are the executables inside ROS Packages. Use ROS client library to communicate with other Nodes. Nodes can publish or subscribe to a Topic. Nodes can also provide and use a Service. Client libraries are rospy and roscpp.
roscore = ros+core : master (provides name service for ROS) + rosout (stdout/stderr) + parameter server must be run at first when using ROS
rosnode = ros+node : ROS tool to get information about a node.
rosnode list
lists all nodes
rosnode info /<node_name>
more info about specific node eg.: where it publishes to
rosrun = ros+run : runs a node from a given package.
rosrun <node_name>
directly run a node
2 Nodes communicate over ROS Topics. One Node publishes and the other subscribes to a certain Topic. With rqt_graph (run from a new terminal window) these nodes an Topics are shown.
rostopic -h
... to get a list of sub commands
listens to one topic
prints all available topics
retuns the type of a topic
rostopic pub [topic] [msg_type] [args]
Services allow nodes to send a request and receive a response.
rosservice list print information about active services
rosservice call call the service with the provided args
rosservice type print service type
rosservice find find services by service type
rosservice uri print service ROSRPC uri
store and manipulate data on the ROS Parameter Server
rosparam set set parameter
rosparam get get parameter
rosparam load load parameters from file
rosparam dump dump parameters to file
rosparam delete delete parameter
rosparam list list parameter names
rqt provides different visual services eg rqt_graph, rqt_console & logger_level, rqt_plot
roslaunch
Launches a node as specified in the .launch file. It is good Practice to have a launch dir with the .launch files although not necessary.