预先已经准备好工作空间。
1.创建一个功能包:
yyw@yyw-vpc:~/catkin_ws/src roscore
3.运行turtle:
yyw@yyw-vpc:~$ rosrun turtlesim turtlesim_node
4.参数命令的使用:
1》rosmaster 本身提供的参数:rosparam list
yyw@yyw-vpc:~$ rosparam list
/rosdistro
/roslaunch/uris/host_yyw_vpc__38249
/rosversion
/run_id
/turtlesim/background_b
/turtlesim/background_g
/turtlesim/background_r
2》显示某个参数值:rosparam get param_key
yyw@yyw-vpc:~$ rosparam get /turtlesim/background_b
255
3》设置参数值:rosparam set param_key param_value
yyw@yyw-vpc:~$ rosparam set /turtlesim/background_b 100
4》保存参数到文件rosparam dump file_name
yyw@yyw-vpc:~$ rosparam dump param.yaml
5》从文件读取参数:rosparam load file_name
yyw@yyw-vpc:~$ rosparam load param.yaml
6》删除参数:rosparam delete param_key
7》将参数刷新,发送指令:rosservice call /clear "{}"
网友评论