-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversation
@@ -268,6 +276,16 @@ impl TopicManager { | |||
topic: topic[0].clone(), | |||
rotation: 0, | |||
}), | |||
"geometry_msgs/PolygonStamped" => { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Build failing because of what reported in here |
54f391e
to
8db68f6
Compare
@@ -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. |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
8db68f6
to
d4d1c3c
Compare
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(); |
There was a problem hiding this comment.
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?
?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
No description provided.