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
Replaced collision checking from MoveIt by a direct interface to FCL #125
Conversation
…ica.git into vi-collisionscene
- Workaround for travis-ci/apt-source-safelist#229
* @return The collision world links. | ||
*/ | ||
virtual std::vector<std::string> getCollisionWorldLinks() | ||
{ |
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.
Why are e.g. these two methods fully defined in the header while the others are in the implementation cpp?
* @return The collision robot links. | ||
*/ | ||
virtual std::vector<std::string> getCollisionRobotLinks() | ||
{ |
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.
see above
|
||
namespace fcl_convert | ||
{ | ||
void fcl2Eigen(const fcl::Vector3d & fcl, Eigen::Vector3d & eigen) |
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.
All of the fcl2Eigen are unused in the project as of now - remnant?
} | ||
else | ||
{ | ||
new_object = cache_entry->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.
Not sure but this may be a copy operation, so perhaps move new_object into the if(cache_entry==end()
and the L99 fixed in both the if and else block with the corresponding right-hand-side, i.e. the else-block would be fcl_objects_[i++] = cache_entry->second.get();
and the if-block fcl_objects_[i++] = constructFclCollisionObject(object.second).get();
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.
Nope, just copying the pointer, not the data.
} | ||
} | ||
|
||
// This function was copied from 'moveit_core/collision_detection_fcl/src/collision_common.cpp' |
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.
Provide link to the file in the ros-planning/moveit GitHub repository so people can check for license, changes, etc.
@@ -10,7 +10,6 @@ | |||
|
|||
<PlanningScene> | |||
<Scene> | |||
<!-- Computing distances is enabled by default, disable for a Sampling problem by setting the PlanningMode to speed up Scene updates --> |
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 this comment was helpful for people using the example configs to learn about how the system works.
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.
That is a deprecated parameter. I removed it from the XML.
<< joint_index_.size() << " but " << x.rows() | ||
<< " is provided"); | ||
|
||
if (BaseType == BASE_TYPE::FIXED) |
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.
Since this was such a major pain to fix, just to make sure: does the new CollisionScene work correctly for a) fixed base, b) floating base, c) mixed base, i.e. model is floating base but planning group is fixed base?
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.
There is no base handling in the collision scene. All of that is in the KinematicTree.
@@ -552,6 +553,19 @@ PYBIND11_MODULE(_pyexotica, module) | |||
samplingProblem.def("getSpaceDim", &SamplingProblem::getSpaceDim); | |||
samplingProblem.def("getBounds", &SamplingProblem::getBounds); | |||
|
|||
py::class_<CollisionProxy, std::shared_ptr<CollisionProxy>> proxy(module, "Proxy"); | |||
proxy.def(py::init()); | |||
proxy.def_readonly("Contact1", &CollisionProxy::contact1); |
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.
A bit at unease with the inconsistency of using Uppercase at the start of variables - sometimes it's lower case (most common), then in other places suddenly uppercase...
} | ||
return py::make_tuple(d, p1, p2); | ||
}); | ||
scene.def("isStateValid", [](Scene* instance, bool self) {return instance->getCollisionScene()->isStateValid(self);}, py::arg("self")=true); |
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'd like the margin/safe distance back - we used it heavily in the past (both in C++ and in Python).
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.
See above.
instance->getCollisionScene()->getRobotDistance(link, self, d, p1, p2, norm, c1, c2, safeDist); | ||
return py::make_tuple(d, norm); | ||
}); | ||
scene.def("getDistance", [](Scene* instance, std::string o1, std::string o2, |
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 we should bring this one back.
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.
Done. The return is a vector of proxies.
|
…ica.git into vi-collisionscene
data->Proxies.push_back(p); | ||
} | ||
|
||
bool CollisionSceneFCLLatest::collisionCallbackDistance(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, void* data, double& dist) |
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.
dist
is now being passed in as a reference but not assigned a value/used as part of the function - computeDistance changes the values in data_
but dist
does not get assigned a value.
world_joint_ + "/trans_y", x(1)); | ||
ps_->getCurrentStateNonConst().setVariablePosition( | ||
world_joint_ + "/trans_z", x(2)); | ||
KDL::Rotation rot = KDL::Rotation::EulerZYX(x(3), x(4), x(5)); |
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.
This is why never noticed the ZYX <> RPY bug in Kinematica in practice - Kinematica was never used for floating base and the MoveIt planning scene for sampling based planning was correct due to this.
Cf. #138
CollisionScene
to a separate header and turned it into an abstract class.KinematicElement
into a separate header.CollisionScene
class.KinematicElement
s.SceneInitializer
property to set the collision scene (selecting a plugin to load).fcl_catkin
package compiling the FCL 0.6.0 from source (submodue).CollisionSceneFCLLatest
correctly computing correct distances between shapes using FCL 0.6.0 (insteas of the outdated moveit version).CollisionProxy
class capturing distances between shapes andpublishProxies
method to publish them as markers to Rviz.When computing distances/proxies: