With rqt_plot
you need specify what data (message attribute) you're trying to plot, as messages can be composed of many other messages (which the Navdata
message is). If it were to just plot an entire message you could end up with a big mess of plot lines crossing over each other. Besides, some data are strings and arrays. How do you plot a string or an array?
rostopic
will happily print whatever message it receives because it's not plotting the data, just printing out what it receives.
So, to plot the information that you want (altitude for instance) you can use
rosrun rqt_plot rqt_plot /ardrone/navdata/altd
and then rqt_plot
will plot the time vs. altitude for you. You can follow the same pattern at the top of rqt_plot
by entering the topic then specifying the message attribute you want to plot.
Originally posted by jayess with karma: 6155 on 2017-11-13
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by Ishi on 2017-11-13:
I tried what you said and i get the error:
TopicCompleter.update_topics(): could not get message class for topic type "cvg_sim_msgs/Altimeter" on topic "/altimeter"
I tried to plot the horizontal velocity vx:
rosrun rqt_plot rqt_plot /ardrone/navdata/vx
I got the same error
Comment by Ishi on 2017-11-13:
When I run rostopic type /ardrone/navdata/vx I get ardrone_autonomy/Navdata vx float32
Comment by jayess on 2017-11-13:
Are you using a simulator or a real drone? That message is telling you that you're missing the cvg_sim_msgs
package. This error should be solved using another question.
Comment by Ishi on 2017-11-13:
I am using a simulator.
Comment by jayess on 2017-11-13:
Did you run
source ~/catkin_ws/devel/setup.bash
after compiliing?
Comment by jayess on 2017-11-13:
Also, if you look at https://answers.ros.org/question/72739/cant-plot-some-messages-types-on-rqt_plot/ you'll see that you need to have the message definitions (cvg_sim_msgs
package) and you may need to restart rqt_plot
in addition to compiling/source
ing.
Comment by Ishi on 2017-11-13:
I did run source ~/catkin_ws/devel/setup.bash
Comment by jayess on 2017-11-13:
Did you install the cvg_sim_msgs
package?
Comment by Ishi on 2017-11-14:
I installed the tum_simulator package and ran catkin_make. cvg_sim_msgs is within the tum_simulator.