-
Notifications
You must be signed in to change notification settings - Fork 281
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 joints #961
Visualize joints #961
Conversation
Signed-off-by: Atharva Pusalkar <[email protected]>
Signed-off-by: Atharva Pusalkar <[email protected]>
Signed-off-by: Atharva Pusalkar <[email protected]>
…into visualize_joints
…into visualize_joints
Signed-off-by: Atharva Pusalkar <[email protected]>
…into visualize_joints
…into visualize_joints
…into visualize_joints
Signed-off-by: Atharva Pusalkar <[email protected]>
…into visualize_joints
Signed-off-by: Atharva Pusalkar <[email protected]>
friendly ping @chapulina @iche033 |
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.
So great to see we're about to have joint visuals!
I tested with this model:
https://app.ignitionrobotics.org/OpenRobotics/fuel/models/Demo%20Joint%20Types
I see that the revolute, revolute2 and universal joints seem to be missing the joint pose offset:
src/gui/plugins/scene3d/Scene3D.cc
Outdated
@@ -1040,6 +1046,32 @@ void IgnRenderer::Render(RenderSync *_renderSync) | |||
} | |||
} | |||
|
|||
// View inertia |
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.
// View inertia | |
// View joints |
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 joint visual pose should be fixed by 101a1e7
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.
looking good, have a few optimization suggestions.
src/rendering/RenderUtil.cc
Outdated
/// \param[in] _ecm The entity-component manager | ||
public: void FindJointModels(const EntityComponentManager &_ecm); | ||
|
||
/// \brief A list of models used to create new inertia visuals |
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.
inertia
-> joint
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/rendering/SceneManager.cc
Outdated
auto axis1UseParentFrame = | ||
(_joint.Axis(0)->XyzExpressedIn() == "__model__")? true : false; | ||
auto axis2UseParentFrame = | ||
(_joint.Axis(1)->XyzExpressedIn() == "__model__")? true : false; |
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 think the logic can be be simplified to something like:
bool axis2UseParentFrame =
_joint.Axis(1)->XyzExpressedIn() == "__model__";
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/rendering/SceneManager.cc
Outdated
if (this->dataPtr->visuals.find(_parentId) != this->dataPtr->visuals.end()) | ||
{ | ||
auto parentName = this->dataPtr->visuals[_parentId]->Name(); |
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.
nitpick: store the find result to avoid a second lookup:
auto it = this->dataPtr->visuals.find(_parentId);
if (it != this->dataPtr->visuals.end())
{
auto parentName = it->second->Name();
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/rendering/SceneManager.cc
Outdated
{ | ||
auto axis1 = _joint.Axis(0)->Xyz(); | ||
auto axis1UseParentFrame = | ||
(_joint.Axis(0)->XyzExpressedIn() == "__model__")? true : false; |
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.
same comment as before about simplifying the logic here
bool axis1UseParentFrame =
_joint.Axis(0)->XyzExpressedIn() == "__model__";
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/rendering/RenderUtil.cc
Outdated
!= this->dataPtr->wireBoxes.end()) | ||
{ | ||
ignition::rendering::WireBoxPtr wireBox = | ||
this->dataPtr->wireBoxes[jointEntity]; |
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.
nitpick: store find result to avoid second lookup:
auto wireBoxIt = this->dataPtr->wireBoxes.find(jointEntity);
if (wireBoxIt != this->dataPtr->wireBoxes.end())
{
ignition::rendering::WireBoxPtr wireBox = wireBoxIt->second;
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 changing a If I add the |
Signed-off-by: Atharva Pusalkar <[email protected]>
Signed-off-by: Atharva Pusalkar <[email protected]>
Signed-off-by: Atharva Pusalkar <[email protected]>
…nto visualize_joints
The scaling and |
Signed-off-by: Atharva Pusalkar <[email protected]>
The axis2 pose issue should be fixed by I am able to visualize the universal joint demo for the |
Codecov Report
@@ Coverage Diff @@
## main #961 +/- ##
==========================================
- Coverage 64.66% 63.78% -0.89%
==========================================
Files 242 246 +4
Lines 19014 19996 +982
==========================================
+ Hits 12296 12755 +459
- Misses 6718 7241 +523
Continue to review full report at Codecov.
|
yep, I just fixed the model on Fuel. It should now show the axis. You'll need to clear the one in your fuel cache (
I was able to see what you have now! Just one minor detail - the red axis is missing an arrow head. |
I see. For that the ign-rendering class would require a small patch in the |
ok I see, can you create a pull request for this? |
Created a PR - gazebosim/gz-rendering#387 |
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 good to me!
@osrf-jenkins retest this please |
This pull request has been mentioned on Gazebo Community. There might be relevant details there: |
🎉 New feature
Closes #106
Requires gazebosim/gz-rendering#366
Summary
Adds the ability to visualize joints of simulation models, similar to Gazebo Classic
Test it
Test it by right-clicking on a model and selecting
View -> Joints
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge