rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
684 stars 339 forks source link

Fix usage of CompareFirst/SecondBodyName return value #1361

Closed Puttichai closed 3 months ago

Puttichai commented 4 months ago

Summary

The recently added CompareFirstBodyName and CompareSecondBodyName functions in CollisionPairInfo return 0 when the given string compares equal to the first and second body names, respectively.

There are some places that expect to test for equality but are missing the test == 0.

For example, in StateCheckEndEffector::_CheckCollisionPair, the condition reads

if( !!pbody && cpinfo.CompareSecondBodyName(pbody->GetName()) ) {

while the original code reads

if( it->GetBody() == pcolliding ) {
rdiankov commented 3 months ago

thanks!