Main Content
Connect to ROS Master from MATLAB and Read Current State of Robot
Execute the
rosinit
command from MATLAB® with the IP address of the Linux host where the ROS master is running.Execute
rostopic list
,rosnode list
,rosservice list
androsaction list
commands 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
jMsg
contains the robot data in the structure depicted by sensor_msgs/JointState.