How does matlab send message to ros turtlesim
I'm trying to use matlab to move the turtle in turtlesim, but it doesn't work. The code is shown:
host = 'usr'; port = 11311; rosinit(host,port)
vel_topic = "/turtle1/cmd_vel"; msg_type = "geometry_msgs/Twist"; velpub = rospublisher(vel_topic,msg_type,"DataFormat","struct"); msg = rosmessage(velpub);
msg.linear.x =1; send(velpub,msg);
I don't get any error messages, but it doesn't work.