- Back to Home »
- Programación , ROS »
- Useful ROS commands
Posted by :
Unknown
domingo, 6 de diciembre de 2015
1.- Workspace:
Create and build and empty workspace:
For the examples the workspace is called “catkin_ws”:Create a package:
Go to the source directory of the workspace: cd ~/catkin_ws/src
then create a package catkin_create_pkg [depend1] [depend2] [depend3]
catkin_create_pkg requires that you give it a package_name and optionally a list of dependencies on which that package depends.Example:
catkin_create_pkg turtlebot_controller turtlesim geometry_msgs std_msgs roscpp rospy
The name of the package is "turtlebot_controller" and the dependences are "turtlesim", "geometry_msgs", "std_msgs", "roscpp" and "rospy"
Build the packages in the catkin workspace:
cd ~/catkin_ws
catkin_make
To add the workspace to the ROS environment :
. ~/catkin_ws/devel/setup.bash
2.- Running and see states:
Start using ROS:
roscore
this command is the first thing you should run when using ROS.Run a node of a package:
rosrun [package_name] [node_name]
Displays ROS nodes that are currently running:
rosnode list
/rosout is always presentDisplay more information about a node currently running:
rosnode info [node]
Example: rosnode info /rosout
Displays ROS topics that are currently present:
rostopic list
See the actual messages that are being published on a topic:
rostopic echo [topic]
Get information about ROS topics:
rostopic type [topic]