Ask Your Question

Cannot use rqt_plot to plot ardrone/navdata

asked 2017-11-11 12:54:15 -0500

Ishi gravatar image

updated 2017-11-13 19:19:42 -0500

I am new to ros. I just starting working with the tum_simulator, ardrone_autonomy and tum_ardrone packages. I am using the simulation in tum_simulator and not an actual drone. I would like to plot ardrone/navdata using rqt_plot. When I tried this I get a blank screen. The command I used was

$ rosrun rqt_plot rqt_plot /ardrone/navdata

When I run

$ rostopic echo /ardrone/navdata

I get the values. I don't understand why I can't plot the values that I obtain using rostopic echo.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-11-12 23:27:52 -0500

jayess gravatar image

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.

edit flag offensive delete link more


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

Ishi gravatar image Ishi  ( 2017-11-13 08:29:11 -0500 )edit

When I run rostopic type /ardrone/navdata/vx I get ardrone_autonomy/Navdata vx float32

Ishi gravatar image Ishi  ( 2017-11-13 08:32:18 -0500 )edit

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.

jayess gravatar image jayess  ( 2017-11-13 10:35:46 -0500 )edit

I am using a simulator.

Ishi gravatar image Ishi  ( 2017-11-13 19:18:56 -0500 )edit

Did you run

source ~/catkin_ws/devel/setup.bash

after compiliing?

jayess gravatar image jayess  ( 2017-11-13 19:24:16 -0500 )edit

Also, if you look at 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/sourceing.

jayess gravatar image jayess  ( 2017-11-13 19:27:03 -0500 )edit

I did run source ~/catkin_ws/devel/setup.bash

Ishi gravatar image Ishi  ( 2017-11-13 19:27:28 -0500 )edit

Did you install the cvg_sim_msgs package?

jayess gravatar image jayess  ( 2017-11-13 19:53:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-11-11 12:51:35 -0500

Seen: 272 times

Last updated: Nov 13 '17