| ²é¿´: 523 | »Ø¸´: 1 | |||
yadan33гæ (³õÈëÎÄ̳)
|
[½»Á÷]
ROS-service & parameter
|
|
ÕâÊÇÒ»ÖÖµ¥¶Ôµ¥µÄÐÎʽ£¬²»ÓÃÓë֮ǰµÄ·¢²¼ºÍ¶©ÔÄ 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 ¿´¿´µ±Ç°nodeµÄ·þÎñ $ rosservice list ²é¿´ÀàÐÍrosservice type [service] $ rosservice type clear std_srvs/Empty ££±íʾµ±·þÎñcallʱ£¬Ã»ÓÐÈκβÎÊý£¨·¢ËÍÇëÇóÊÇûÓÐÊý¾Ý£¬½ÓÊÜÏìӦʱҲûÓÐÊý¾Ý µ÷Óà rosservice call [service] [args] $ rosservice call /clear Çå³ýÁË֮ǰµÄ¹ì¼£ $ rosservice type spawn | rossrv show ££ÏÔʾ·þÎñÃèÊö $ rosservice call spawn 2 2 0.2 "" £££´´½¨ÐµÄСº£¹ê£¬¸ø¶¨²ÎÊýx,y,theta,name£¨ÕâÀïnameΪ¿Õ£©Ëû×Ô¶¯·µ»Øname: turtle2 ²ÎÊý 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 rosparam set [param_name] rosparam get [param_name] $ rosparam get / Here we write all the parameters to the file params.yaml $ rosparam dump params.yaml You can even load these yaml files into new namespaces, e.g. copy: $ rosparam load params.yaml copy $ rosparam get copy/background_b Using rqt_console and roslaunch Èç¹ûûװrqt»òÕßturtlesim $ sudo apt-get install ros-<distro>-rqt ros-<distro>-rqt-common-plugins ros-<distro>-turtlesim rxconsole ÊÇÁ¬½ÓROS ÈÕÖ¾Îĵµ£¬²¢½«½ÚµãµÄÕâЩÐÅÏ¢ÏÔʾÔÚ´°ÌåÄÚ¡£ rxloggerlevel ¿ÉÒÔÏÔʾÔËÐÐÖнڵãµÄDEBUG£¬WARN£¬INFO ºÍERRORÐÅÏ¢ ÓÃÀ´ÏÔʾ½ø³ÌÔËÐйý³ÌÖгöÏֵĴíÎ󾯸æÖ®Àà rostopic pub /turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}' »á±¨´í ÈÕÖ¾(logger)²ã ÐÅÏ¢°üÀ¨£ºFatal, Error, Warn, Info, Debug£¬ËûÃÇÉèÖÃÒÀ´Î´Ó¸ßµ½µÍ£¬±ÈÈçÉèÖÃWarn,ÎÒÃDZØÐëÖªµÀInfo, DebugÐÅÏ¢£¬ÎÒÃÇ¿ÉÒÔ×ö»¹ÔÚÉèÖÃÖªµÀwarnning roslaunch $ roslaunch [package] [filename.launch] ´ò¿ª°ü $ roscd beginner_tutorials Èç¹û³öÏÖÀàËÆÕâÖÖ´íÎóNo such package/stack 'beginner_tutorials' £¬ÒªÏÈsourceһϻ·¾³ $ cd ~/catkin_ws $ source devel/setup.bash $ roscd beginner_tutorials ÔÙÀ´½¨Ò»¸ölaunchÎļþ¼Ð $ mkdir launch $ cd launch ÆäʵҲ¿ÉÒÔ²»Óý¨£¬roslauchÃüÁî»á×Ô¼ºÈ¥Ñ°ÕÒ.launchÎļþ ½¨Ò»¸öturtlemimic.launchÎļþ£¬ÄÚÈÝÈçÏ 1 <launch> 2 3 <group ns="turtlesim1"> 4 <node pkg="turtlesim" name="sim" type="turtlesim_node"/> 5 </group> 6 7 <group ns="turtlesim2"> 8 <node pkg="turtlesim" name="sim" type="turtlesim_node"/> 9 </group> 10 11 <node pkg="turtlesim" name="mimic" type="mimic"> 12 <remap from="input" to="turtlesim1/turtle1"/> 13 <remap from="output" to="turtlesim2/turtle1"/> 14 </node> 15 16 </launch> launchÎļþÚ¹ÊÍ£º 1 <launch>££££ÒÔlaunch×÷ΪlaunchÎļþ¿ªÍ· 23 <group ns="turtlesim1"> ££££ÒÔturlesim1ΪÃûµÄÎļþ¼Ð»òÕßÃüÃû¿Õ¼äµÄ½Úµã 4 <node pkg="turtlesim" name="sim" type="turtlesim_node"/> 5 </group>6 7 <group ns="turtlesim2">££££ÒÔturlesim2ΪÃûµÄÎļþ¼Ð»òÕßÃüÃû¿Õ¼äµÄ½Úµã 8 <node pkg="turtlesim" name="sim" type="turtlesim_node"/> 9 </group> 10 11 <node pkg="turtlesim" name="mimic" type="mimic">£££ÔÚÖ÷ÌâÉÏÄ£·Â½ÚµãµÄÊäÈëºÍÊä³ö£¬²¢ÖØÃüÃûturlesim1,turlesim2,±ÈÈ磺turlesim1±ä³Émimicturtlesim1 12 <remap from="input" to="turtlesim1/turtle1"/> 13 <remap from="output" to="turtlesim2/turtle1"/> 14 </node> 15 16 </launch> ££££¹Ø±ÕlaunchÎļþ ¿ÉÒÔÔËÐÐһϠ$ roslaunch beginner_tutorials turtlemimic.launch »á³öÀ´Á½¸öÎÚ¹ê $ rostopic pub /turtlesim1/turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, -1.8]' Á½¸öÎÚ¹êÒ»Æð»Ô² |
» ²ÂÄãϲ»¶
366Çóµ÷¼Á
ÒѾÓÐ9È˻ظ´
²ÄÁϹ¤³Ì085601£¬270Çóµ÷¼Á
ÒѾÓÐ37È˻ظ´
279ѧ˶ʳƷרҵÇóµ÷¼ÁԺУ
ÒѾÓÐ18È˻ظ´
290µ÷¼ÁÉúÎï0860
ÒѾÓÐ31È˻ظ´
Ò»Ö¾Ô¸085802 323·ÖÇóµ÷¼Á
ÒѾÓÐ13È˻ظ´
277Çóµ÷¼Á
ÒѾÓÐ23È˻ظ´
322Çóµ÷¼Á£¬08¹¤¿Æ
ÒѾÓÐ4È˻ظ´
²ÄÁϹ¤³Ì281»¹Óе÷¼Á»ú»áÂð
ÒѾÓÐ30È˻ظ´
»¯Ñ§070300 Çóµ÷¼Á
ÒѾÓÐ16È˻ظ´
»¯¹¤Ñ§Ë¶294·Ö£¬Çóµ¼Ê¦ÊÕÁô
ÒѾÓÐ12È˻ظ´
yadan33
гæ (³õÈëÎÄ̳)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 167.2
- ºì»¨: 1
- Ìû×Ó: 29
- ÔÚÏß: 2.6Сʱ
- ³æºÅ: 4136693
- ×¢²á: 2015-10-12
- רҵ: »úÆ÷ÈËѧ¼°»úÆ÷È˼¼Êõ
|
Using rosed to edit files in ROS $ rosed [package_name] [filename] ¿ÉÒÔÖ±½Ó±à¼°üÀïÃæÎļþ£¬²»ÐèÒªÖªµÀλÖà $ rosed roscpp Logger.msg This example demonstrates how you would edit the Logger.msg file within the roscpp package ѧ»áÓÃtab¼ü£¬¾Í²»ÐèÒªÖªµÀÎļþµÄÃû×Ö $ rosed [package_name] <tab><tab> Example: $ rosed roscpp <tab><tab> »á³öÀ´Ò»¶Ñ Empty.srv package.xml GetLoggers.srv roscpp-msg-extras.cmake Logger.msg roscpp-msg-paths.cmake SetLoggerLevel.srv roscpp.cmake genmsg_cpp.py roscppConfig-version.cmake gensrv_cpp.py roscppConfig.cmake msg_gen.py vim²»ÊÇros×Ô´øµÄ£¬¸ÄĬÈÏ±à¼Æ÷Ϊros×Ô´øµÄnano You can use it by editing your ~/.bashrc file to include: export EDITOR='nano -w' export EDITOR='emacs -nw' NOTE: changes in .bashrc will only take effect for new terminals. Terminals that are already open will not see the new environmental variable ¿´Ò»Ï¸ijÉûÓÐ Open a new terminal and see if EDITOR is defined: $ echo $EDITOR nano -w or emacs -nw |
2Â¥2016-08-10 17:44:53













»Ø¸´´ËÂ¥
20