Matlab与ROS通信设置

测试matlab功能

help robotics.ros
rosinit
exampleHelperROSCreateSampleNetwork (运行例子程序)

1.查看ubuntu系统的ip

ifconfig  192.168.1.106

2. 查看window系统的ip

ipconfig  192.168.1.101

3.在ubuntu中设置ROS_IP

gedit ~/.bashrc

export ROS_IP=192.168.1.106 #添加本机ip

source ~/.bashrc

4.在matlab中设置环境变量


setenv('ROS_MASTER_URI','http://192.168.1.106:11311')#主节点ip
setenv('ROS_IP','192.168.1.106')
rosinit('192.168.1.106', 'NodeHost', '192.168.1.101')

5.ROS---->matlab

roscore
rosrun roscpp_tutorials talker
在matlab中查看ubuntu中发布的话题

6.matlab---->ROS

在matlab中打开testROS.m文件,运行。在ubuntu系统中查看matlab发布的话题

猜你喜欢

转载自blog.csdn.net/cdlwhm1217096231/article/details/81139664