ROS相关 Open Robotics:常用命令
常用命令
-
rostopic pub [data…]
NOTE: KEY Tab always useful!There are three modes that rostopic can publish in:
(1). Latching mode:rostopic will publish a message to /topic_name and keep it latched – any new subscribers that come online after you start rostopic will hear this message. You can stop this at any time by pressing ctrl-C.
(2). Once mode:If you don’t want to have to stop rostopic with ctrl-C, you can publish in once mode. rostopic will keep the message latched for 3 seconds, then quit.
(3). Rate mode:In rate mode, rostopic will publish your message at a specific rate. For example, -r 10 will publish at 10hz. For file and piped input, this defaults to 10hz.
Options:
-l, --latch: Enable latch mode. Latching mode is the default when using command-line arguments. Publishing and latching message. Press ctrl-C to terminate
-r RATE: Enable rate mode. Rate mode is the default (10hz) when using piped or file input.
-1, --once: Enable once mode. publishing and latching message for 3.0 seconds
-f FILE: Read message fields from YAML file. YAML syntax is equivalent to output of rostopic echo. Messages are separated using YAML document separator —. To use only the first message in a file, use the --latch option. (Data types are be interpreted using YAML-syntax, e.g. 1 is an integer, 1.0 is a float, and foo is a string. )
e.g.
(1). Latching
rostopic pub /topic_name std_msgs/String hello
rostopic pub my_topic std_msgs/String “hello there”
(2). Once
rostopic pub -1 my_topic std_msgs/String “hello there”
(3). RATE
rostopic pub -r 10 my_topic std_msgs/String “hello there”
(4). FILE
NEED TO ADD
REFERENCE: http://wiki.ros.org/rostopic -
rosclean
clean the cache of current workspace.
e.g. cd to your workspace
rosclean check
y
y -
killall -9 roscore
killall -9 rosmaster
-
killall gzserver
killall gzclient