Connect to ROS Master from MATLAB and Read Current State of Robot
Execute the
rosinitcommand from MATLAB® with the IP address of the Linux host where the ROS master is running.Execute
rostopic list,rosnode list,rosservice listandrosaction listcommands to view list of accessible nodes, topics, services and actions.Execute the following set of commands to read current robot state.
jSub = rossubscriber('/joint_states'); jMsg = receive(jSub);The
jMsgcontains the robot data in the structure depicted by sensor_msgs/JointState.