Turtlebot3与Matlab入门教程-连接matlab和turtlebot3
说明:
- 介绍如何连接matlab和turtlebot3
步骤:
在turtlebot3端
- 启动turtlebot3
$ roslaunch turtlebot3_bringup turtlebot3_robot.launch
在Matlab端
turtlebot3端的ip:192.168.0.93
PC端的ip:192.168.0.197新建.m文件
代码如下:
function connection_turtlebot3()
ip_robot = '192.168.0.93';
rosinit(ip_robot, 'NodeHost', '192.168.0.197')
end
运行m文件
结果如下:
Initializing global node /matlab_global_node_44912 with NodeURI http://192.168.0.93:49174/
- 打印话题:
>> rostopic list
/battery_state
/cmd_vel
/cmd_vel_rc100
/diagnostics
/firmware_version
/imu
/joint_states
/magnetic_field
/motor_power
/odom
/reset
/rosout
/rosout_agg
/rpms
/scan
/sensor_state
/sound
/tf
/version_info
- 关闭节点
>> rosshutdown
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号