[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 )

1 2 3