Filesystem Tools
- rospack find xxx
- roscd xxx
- roscd log
- rosls xxx
Creating a ros package
- That package.xml file provides meta information about the package
- Catkin metapackages must have a boilerplate CMakeLists.txt file
workspace_folder/ -- WORKSPACE src/ -- SOURCE SPACE CMakeLists.txt -- 'Toplevel' CMake file, provided by catkin package_1/ CMakeLists.txt -- CMakeLists.txt file for package_1 package.xml -- Package manifest for package_1 ... package_n/ CMakeLists.txt -- CMakeLists.txt file for package_n package.xml -- Package manifest for package_nCreating a workspace for catkin
-
mkdir -p ~/catkin_ws/src
-
cd ~/catkin_ws/src
-
catkin_init_workspace
-
cd ~/catkin_ws/
-
catkin_make
Creating a catkin package
-
cd ~/catkin_ws/src
-
catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
package dependencies
-
rospack depends1 beginner_tutorials
-
rospack depends beginner_tutorials
These dependencies for a package are stored in the package.xml file, look at it.
Building package
-
catkin_make [make_targets] [-DCMAKE_VARIABLES=...]
ros node
A node really isn't much more than an executable file within a ROS package.
roscore is the first thing you should run when using ROS
-
roscore
-
rosnode list
-
rosnode info
-
rosrun [package_name] [node_name]
-
rosnode ping my_turtle
ros topics == message/events
-
rosrun turtlesim turtlesim_node
-
rosrun rqt_graph rqt_graph
-
rostopic -h
-
rostopic echo [topic]
-
rostopic list -h
-
rostopic list -v
-
rostopic type [topic]
-
rosmsg show geometry_msgs/Twist
-
rostopic type /turtle1/command_velocity
-
rosmsg show turtlesim/Velocity
-
rostopic pub [topic] [msg_type] [args]
-
rostopic pub -1 /turtle1/command_velocity turtlesim/Velocity -- 2.0 1.8
-
rostopic pub /turtle1/command_velocity turtlesim/Velocity -r 1 -- 2.0 -1.8
-
rostopic hz [topic]
-
rostopic hz /turtle1/pose
-
rostopic type /turtle1/command_velocity | rosmsg show
sql_plot
rqt_plot displays a scrolling time plot of the data published on topics
rosrun rqt_plot rqt_plot