0
$\begingroup$

Rosanswers logo

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.


Originally posted by Ishi on ROS Answers with karma: 1 on 2017-11-11

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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/sourceing.

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.