Skip to content
Menu
Barely Walking
  • Home
  • Robotics
  • SD, LLMs
  • One shot projects
  • 3d printers
  • About me
Barely Walking
02/10/201816/04/2022

[NotesToMyself] ROS client-server on different machines

assume that 192.168.0.100 is the server and 192.168.0.153 is the client with Matlab
console on the server:

export ROS_IP=192.168.0.100
export ROS_MASTER_URI=http://192.168.0.100:11311
roscore

(and same with rosrun turtlesim turtlesim_node on another console)

matlab:
setenv(‘ROS_MASTER_URI’,’http://192.168.0.100:11311′)
setenv(‘ROS_IP’,’192.168.0.153′)
rosinit
robotctrl = rospublisher( ‘/turtle1/cmd_vel’ )
robotpose = rossubscriber( ‘/turtle1/pose’ )

twist = rosmessage(robotctrl.MessageType)
twist.Linear.X = 1
send(robotctrl,twist)

pause(0.1)
state = receive( robotpose, 1 )

©2025 Barely Walking | Powered by WordPress and Superb Themes!