-
Notifications
You must be signed in to change notification settings - Fork 0
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
agent_info_display plugin using ignition-gui3 #386
Conversation
It almost works * The floating text moves, but the cars stop moving * The plugin will seg-fault if you toggle visibility at the wrong time. There is a data race somewhere.
b0614a3
to
39d1f34
Compare
I wonder if this seg-fault is caused by the same at #384 (comment) EDITED: It is interesting because I used the same approach to toggle the mesh layers and it works properly but now when using text geometries(for the labels) I reach a seg fault as you. |
I think my problem with rendering is related to threads. Looking at the VisualizeLidar plugin in ign-gazebo, it seems that they make rendering calls from an I will try putting all my rendering calls in this type of callback |
This fixes the rendering and the seg-faults by moving all ignition::rendering API calls to the eventFilter function during the ignition::gui::Render event.
this is now working and ready for review |
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.
PTAL
///////////////////////////////////////////////// | ||
void AgentInfoDisplay::UpdateAgentLabel(const ignition::msgs::AgentState& _agent, const std::string& _agentName, | ||
std::shared_ptr<AgentInfoText> _agentInfoText) { | ||
double x = 0.0; |
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.
Can we use a pose to hold all these variables?
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.
it's not so convenient to put them in a Pose3
because ignition::msgs::AgentState
uses its own RPYAngles
representation for orientation so there isn't an easy way to convert to ignition::math::Pose3
I did store the position
and linear_velocity
in Vector3
objects in 04490de since it was convenient to do so
} | ||
|
||
std::stringstream ss; | ||
ss << _agentName << ":\n pos:(x:" << std::setprecision(2) << x << ",y:" << y << ",z:" << z << ",yaw:" << yaw << ")" |
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.
Does ignition::math::Pose3d has an operator<< overload? If so, can we use it?
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 used the <<
operator from the Vector3
class for position
and linear_velocity
. I didn't use it for the orientation because the text label only includes the yaw
currently
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.
in 04490de
Use an ignition::math::Vector3d for position and linear velocity when serializing to string since there is an easy conversion method from ignition::msgs.
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.
LGTM
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.
LGTM, just some nits:
e124de3
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.
LGTM
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.
LGTM!
This migrates the
agent_info_display0
plugin fromignition-gui0
to useignition-gui3
. I started by copying a bit of the approach fromOriginDisplay
added in #375 but ran into some rendering problems. Copying theeventFilter
from the Screenshot plugin and moving allignition::rendering
calls into that plugin fixed things for me. I was also able to get rid of thetimerEvent
by using theeventFilter
.