-
Notifications
You must be signed in to change notification settings - Fork 276
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
Visualize ContactSensorData #234
Conversation
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Work is being done on visualizing contacts for |
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 tested with
$ ign gazebo visualize_contacts.sdf -r
Looks good. The contacts show up, but the text boxes don't show up correctly for me. I only see 1 digit. So initially I just see 0
and 0
for both radius and length. if I arrow to the left, I'd eventually see the decimal point 0.
, but I can never see the entire number. I dragged the panel to the left to expand it, but the text boxes didn't expand. Maybe they can be set to a longer length.
What are the units of the adjustable parameters? I would suggest putting that unit to the right of the text boxes.
Hmm that's weird. Does that happen to you if you load the Grid Config plugin, which also has spin boxes? |
Hmm yeah actually it does in Grid Config plugin as well: Looking at this, maybe you could center everything in the Visualize contacts panel too for consistency. I think the spin boxes being too short is a GUI problem. It should probably be fixed elsewhere, but it should be fixed. I'm on a 4k laptop screen, and most windows and menus are automatically scaled up 2x. That may or may not be related to this problem. It's a pretty common laptop so others will run into this as well. @chapulina Is this a known issue? I took a scan in ign-gui and didn't see a related ticket. Let me know if I should make one. Could be a good first issue. |
It's possible to set the width of |
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Signed-off-by: Martiño Crespo <marticres@gmail.com>
In order to visualize the contacts for objects without contact sensors, we've encountered some problems and solved them the following way:
Also, I've intentionally removed some of the contact sensors from the example world for testing the plugin. |
@chapulina I've changed that and @mabelzhang should be able to see the spin boxes. The problem is the extra space between the different elements: I guess that's because of the |
The trick to press them together is to add an invisible "spacer" item at the bottom of the layout like this: With |
Confirming text boxes are automatically expanding for me now after dragging the panel to the left. |
Signed-off-by: Martiño Crespo <marticres@gmail.com>
Sounds to me like most things in this ticket are resolved, other than bullet 3 linked in the previous comment. @azeey Is this something acceptable that we can create an issue for the future and merge this PR, or does that bullet need to be fixed before this goes in? |
Yeah, I think we can create an issue for it and merge this PR. @mcres, I haven't been able to reproduce the issue on the |
@azeey This is the sequence:
I used to encounter 2 issues:
If this isn't reproducible, merging and opening an issue if it happens again makes sense to me! |
I haven't been able to reproduce the two issues you mentioned. But I noticed what I think is a performance issue with Markers. When the update period is set to a shorter amount of time, the gui becomes jumpy after a little while This is what I think is going on. When an existing marker is modified, a new material is created for it. This material is then assigned to the existing marker visual. This causes the existing material for the marker to get removed. Over time, this becomes really expensive for some reason. My guess is Ogre has an ever increasing list of resource names that has to be traversed even if the actual active list of materials is kept small. Profiling it showed a hotspot in |
I see, I didn't notice about that. |
That sounds good. Do you mind resolving the merge conflict? |
Signed-off-by: Martiño Crespo <marticres@gmail.com>
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.
Looks like tests are failing https://build.osrfoundation.org/job/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/4598/testReport/junit/(root)/ContactSystemTest/MultipleCollisionsAsContactSensors/:
/var/lib/jenkins/workspace/ignition_gazebo-ci-pr_any-ubuntu_auto-amd64/ign-gazebo/test/integration/contact_system.cc:118
Value of: contactMsgs.size()
Actual: 10
Expected: 0u
Which is: 0
Hmm I have no idea where this could come from and to be honest for me it would probably take more time than I have. |
This fixes a test failure where the expected number of contacts is zero, but we were sending dummy data to workaround an ECM synchronization issue. Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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.
src/systems/physics/Physics.cc
Outdated
msgs::Contacts contactsComp; | ||
|
||
for (const auto &[collEntity2, contactData] : contactMap) | ||
else |
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 don't think this block needs to be inside an else
, because the if
above is returning. We could save some indentation by removing the else
.
Alternatively, you could remove the block that's inside the if
and let the SetData
below set the empty contactsComp
. Makes sense?
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
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 addressed my final comments in c28fc20
This is good to go with happy CI 🚀
Fixes issue #112
This requires #272
It currently visualizes the position of the contacts returned by the Contact sensors.
It also allows the user to change the size of the markers (radius and length) through a couple of spin boxes.
In order to show the contacts of all of the
components::Collision
, it appears it's not enough to create acomponents::ContactSensorData
as stated here, because this is a GUI system.