I've been using the Robotics Toolbox for a while now and I've never seen something like this before. It looks like a Matlab bug, but I don't know if I am doing something wrong.
In summary, I have a simulation running in gazebo that publishes to the topic: '/mavros/state' I created a simple subscriber as follows:
stateSub = rossubscriber('mavros/state');
msg = receive(stateSub)
The msg I received was the following:
Header: [1x1 Header]
However, at the same time I was running the following command in a linux terminal:
rostopic echo /mavros/state
The echoed value in this terminal for the topic '/mavros/state' was the following:
Note that there is a disparity between the value that I got in Matlab and the one I got in the terminal: Matlab says that the Armed and Guided properties are 0 (false), while the terminal says their values are 1 (true).
I know for a fact that the values expected from Armed and Guided are 1 (true), which means that the receive function is returning the wrong value for these properties.
Is this a Matlab bug? Any idea why this would be happening?
Observation: the message type for 'mavros/state' is of the type 'mavros_msgs/State', with the following definitions (obtained from running rosmsg info mavros_msgs/State in a matlab terminal):