Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for polygon stamped message. #93

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

ValerioMagnago
Copy link
Contributor

No description provided.

@@ -268,6 +276,16 @@ impl TopicManager {
topic: topic[0].clone(),
rotation: 0,
}),
"geometry_msgs/PolygonStamped" => {
Copy link
Contributor Author

@ValerioMagnago ValerioMagnago Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do I understand correctly that every time we save the config we will get a different color?

Not part of this PR but should we somehow add some logic to reuse the color of the previous config for the topic that were already added from the beginning?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same for all other topics. So lets keep it for this pr

@ValerioMagnago
Copy link
Contributor Author

Build failing because of what reported in here

@@ -16,7 +16,7 @@ colorgrad = "*"
crossterm = { version = '0.23', features = ["event-stream"] }
futures = "0.3"
futures-timer = "3.0"
image = "*"
image = "0.24" # TODO: tui-image (see below) doesn't allow newer versions.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the general problem here is the dependency to the unmaintained tui-rs. I wrote a ticket to takle it 'some day'. #94

@@ -178,6 +186,10 @@ impl Default for TermvizConfig {
topic: "pointcloud2".to_string(),
use_rgb: false,
}],
polygon_stamped_topics: vec![ListenerConfigColor {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is https://github.com/carzum/termviz/blob/main/src/footprint.rs already. The footprint will be drawn twice now. We could drop the old module for the more generic polygon stamped approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick prototype of this (see https://github.com/ValerioMa/termviz/pull/1/files ). The change is not huge but it is changing some logic and IMO it is worth do discuss in a separate PR.

move |msg: rosrust_msg::geometry_msgs::PolygonStamped| {
let mut unlocked_data = cloned_data.write().unwrap();
unlocked_data.polygon_stamped_msg = Some(msg);
unlocked_data.update();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carzum this update is translating the polygon to the correct position.

Currently we do this every time we receive a new polygon but do not work great on latched topic.

Moving this to the get_lines method it is also not ideal because it will slow down the thread that we use for the visual rendering. Should we anyway move it there and in the future think of adding a separate timer with the task of transforming all the subscribed messages?
?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the draw thread is the one constraining performance at the moment. Having the transform in there could make the application more unresponsive. Regarding latched topics: We have the same issue with other listeners, so far this is not bugging me too much.

@@ -178,6 +186,10 @@ impl Default for TermvizConfig {
topic: "pointcloud2".to_string(),
use_rgb: false,
}],
polygon_stamped_topics: vec![ListenerConfigColor {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick prototype of this (see https://github.com/ValerioMa/termviz/pull/1/files ). The change is not huge but it is changing some logic and IMO it is worth do discuss in a separate PR.

@carzum carzum merged commit 358dc08 into carzum:main Apr 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants