一、官方资料指导
ROS wiki http://wiki.ros.org/
matlab:Robotics system Toobox:ROS http://cn.mathworks.com/help/robotics/robot-operating-system-ros.html
Document http://cn.mathworks.com/help/robotics/functionlist.html#buog82z
说明:matlab2015b以上版本带机器人工具箱和ROS。
二、使用说明
按照matlab指导进行。
1.启动master
直接在matlab终端输入:>>rosinit
The value of the ROS_MASTER_URI environment variable, http://localhost:11311, will be used to connect to the ROS master.
Initializing ROS master on http://yhzhao:11311/.
Initializing global node /matlab_global_node_60577 with NodeURI http://yhzhao:36745/
会启动一个master和global node,再在ubuntu终端启动roscore时会master冲突。
输入:>>rostopic list
/rosout
需在Ubuntu终端先启动roscore,再在matlab终端启动rosinit,此时会连接已有rosmaster并新创建一个global node。
rosinit
The value of the ROS_MASTER_URI environment variable, http://localhost:11311, will be used to connect to the ROS master.
Initializing global node /matlab_global_node_21319 with NodeURI http://yhzhao:56287/
若在不同IP下,可以分布式启动新节点,连接master ip 为 10.0.253.95。输入:>> rosinit(‘10.0.253.95’)
Initializing global node /matlab_global_node_42437 with NodeURI http://10.0.253.95:52610/
2.关闭master
rosshutdown
3.读取消息的:如gazcbo仿真
3.1 Ubuntu启动roscore与gazcbo
roslaunch turtlebot_gazebo gmapping_world.launch
3.2 matlab