0
$\begingroup$

I am working on a project where I need to plot data from ROS2 array topics using rqt_plot. The data I'm dealing with involves multiple array topics, which are published per cycle from another node. The structure of the ROS2 topics is as follows:

float32[] range_m

float32[] velocity_mps

float32[] acceleration_mps2

... (other similar array structures)

Each of these topics represents an array of values that I need to plot in each cycle. However, rqt_plot in its current form has limitations in plotting array topics, particularly when it comes to handling the entire array data for each cycle. It seems to only support plotting specific indexed elements of array topics.

I already attempted and did some research like, modifying rqt_plot for Array Topics: I tried to modify rqt_plot to handle array topics by adjusting functions like _parse_field_name_and_index, get_plot_fields, and _ros_cb. The goal was to allow rqt_plot to interpret entire arrays as single plottable entities rather than requiring an index for each element.

Despite these efforts, I am still facing challenges in getting rqt_plot to correctly plot entire arrays per cycle. The main issues are ensuring data structure compatibility and correctly handling cycle-based data updates.

Seeking Guidance: I am looking for suggestions or guidance on how to effectively modify rqt_plot for this purpose. Specifically, I need assistance with:

  • Correctly modifying rqt_plot functions to handle entire array topics.
  • Implementing an efficient and accurate cycle detection and plotting mechanism.
  • Any known methods or best practices for handling similar scenarios in rqt_plot.

Any insights or advice from the community would be greatly appreciated, especially from those who have experience in modifying rqt_plot or dealing with similar ROS2 visualization challenges.

$\endgroup$
2
  • $\begingroup$ since you seem comfortable writing custom code to solve this problem, why not just write a node which 1. subscribes to the arrays then 2. re-shapes them to a format more useful to rqt_plot and 3. re-publishes them? $\endgroup$ Commented Nov 29, 2023 at 18:42
  • $\begingroup$ @cst0 to have something in between is always inefficient, in other words I could already publish the data in my main node in more friendly way with rqt_plot. However, the publish rate will be significantly higher, in my case it was around 150-170 Hz, this something I dont want. As I told in description, I attempted modifying rqt_plot to handle the entire list. I already managed, it is in testing phase, maybe I will create pull request after completion. $\endgroup$ Commented Nov 30, 2023 at 15:44

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.