-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the flakey rviz_rendering tests (#1026)
* Fix memory leak in effort_visual.cpp. When shutting down, we were forgetting to free the effort_arrow and effort_circle memory. Switch to using unique pointers there, which will take care of this for us. * Make sure to initialize ScrewVisual member variables. Otherwise you can run into situations where the user forgets to call one of the 'set' methods, and we now access uninitialized memory. * Make sure to set the frame orientation and position in effort visual. As the API currently stands, it is very easy to access uninitialized memory by forgetting to call setFramePosition() and setFrameOrientation() before calling setEffort(). Fix at least this bit in the tests, and clean things up a little so this is easier to read. * Change EffortVisual constructor to take width and scale. That way we ensure that these will always be set. * Revamp adding things to the EffortVisual class during setEffort. This is in an attempt to make sure we don't access uninitialized memory. It is a little complicated because it is possible for the user to have set some of the information before the setEffort() call, and we don't want to forget that. So when setEffort() is called, we use the already set values if they are available. If they aren't, we use the identity. On disable, we only erase the effort_arrow and effort_circle, again so we don't forget information the user may have otherwise provided us. With all of this in place, it isn't possible to call setEffort anymore and access uninitialized memory. Signed-off-by: Chris Lalancette <[email protected]>
- Loading branch information
1 parent
657b9ea
commit ebf5435
Showing
6 changed files
with
57 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters