Skip to content
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

Add manipulator/grippername to XML reader #1311

Open
wants to merge 13 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
# Define here the needed parameters
set (OPENRAVE_VERSION_MAJOR 0)
set (OPENRAVE_VERSION_MINOR 136)
set (OPENRAVE_VERSION_PATCH 0)
set (OPENRAVE_VERSION_PATCH 1)
set (OPENRAVE_VERSION ${OPENRAVE_VERSION_MAJOR}.${OPENRAVE_VERSION_MINOR}.${OPENRAVE_VERSION_PATCH})
set (OPENRAVE_SOVERSION ${OPENRAVE_VERSION_MAJOR}.${OPENRAVE_VERSION_MINOR})
message(STATUS "Compiling OpenRAVE Version ${OPENRAVE_VERSION}, soversion=${OPENRAVE_SOVERSION}")
Expand Down
5 changes: 5 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ ChangeLog
Unreleased
==========

Version 0.136.1
===============

* Support reading of `grippername` under `manipulator` from XML files.

Version 0.136.0
===============

Expand Down
28 changes: 25 additions & 3 deletions plugins/configurationcache/configurationjitterer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ By default will sample the robot's active DOFs. Parameters part of the interface
_vActiveIndices = _probot->GetActiveDOFIndices();
_nActiveAffineDOFs = _probot->GetAffineDOF();
_vActiveAffineAxis = _probot->GetAffineRotationAxis();
_vLinks.reserve(_probot->GetLinks().size());
if( _nActiveAffineDOFs == 0 ) {
for (size_t ilink = 0; ilink < _probot->GetLinks().size(); ++ilink) {
if( _probot->GetLinks()[ilink]->GetGeometries().empty() ) {
// Links that don't have geometries (virtual links) don't matter for jittering. Their AABBs can interfere with the results.
continue;
}
for (int dofindex : _vActiveIndices) {
if( _probot->DoesAffect(_probot->GetJointFromDOFIndex(dofindex)->GetJointIndex(), ilink)) {
_vLinks.push_back(_probot->GetLinks()[ilink]);
Expand All @@ -86,7 +91,13 @@ By default will sample the robot's active DOFs. Parameters part of the interface
}
}
else {
_vLinks = _probot->GetLinks();
for (const KinBody::LinkPtr& plink: _probot->GetLinks()) {
if( plink->GetGeometries().empty() ) {
// Links that don't have geometries (virtual links) don't matter for jittering. Their AABBs can interfere with the results.
continue;
}
_vLinks.push_back(plink);
}
}
_vLinkAABBs.resize(_vLinks.size());
for(size_t i = 0; i < _vLinks.size(); ++i) {
Expand Down Expand Up @@ -970,9 +981,14 @@ By default will sample the robot's active DOFs. Parameters part of the interface
vector<KinBodyPtr> vgrabbedbodies;
_probot->GetGrabbed(vgrabbedbodies);
// robot itself might have changed?
_vLinks.resize(0);
_vLinks.reserve(_probot->GetLinks().size());
if( _nActiveAffineDOFs == 0 ) {
_vLinks.clear();
for (size_t ilink = 0; ilink < _probot->GetLinks().size(); ++ilink) {
if( _probot->GetLinks()[ilink]->GetGeometries().empty() ) {
// Links that don't have geometries (virtual links) don't matter for jittering. Their AABBs can interfere with the results.
continue;
}
for (int dofindex : _vActiveIndices) {
if( _probot->DoesAffect(_probot->GetJointFromDOFIndex(dofindex)->GetJointIndex(), ilink)) {
_vLinks.push_back(_probot->GetLinks()[ilink]);
Expand All @@ -982,7 +998,13 @@ By default will sample the robot's active DOFs. Parameters part of the interface
}
}
else {
_vLinks = _probot->GetLinks();
for (const KinBody::LinkPtr& plink: _probot->GetLinks()) {
if( plink->GetGeometries().empty() ) {
// Links that don't have geometries (virtual links) don't matter for jittering. Their AABBs can interfere with the results.
continue;
}
_vLinks.push_back(plink);
}
}
FOREACHC(itgrabbed, vgrabbedbodies) {
FOREACHC(itlink2, (*itgrabbed)->GetLinks()) {
Expand Down
28 changes: 25 additions & 3 deletions plugins/configurationcache/workspaceconfigurationjitterer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ By default will sample the robot's active DOFs. Parameters part of the interface
_vActiveIndices = _probot->GetActiveDOFIndices();
_nActiveAffineDOFs = _probot->GetAffineDOF();
_vActiveAffineAxis = _probot->GetAffineRotationAxis();
_vLinks.reserve(_probot->GetLinks().size());
if( _nActiveAffineDOFs == 0 ) {
for (size_t ilink = 0; ilink < _probot->GetLinks().size(); ++ilink) {
if( _probot->GetLinks()[ilink]->GetGeometries().empty() ) {
// Links that don't have geometries (virtual links) don't matter for jittering. Their AABBs can interfere with the results.
continue;
}
for (int dofindex : _vActiveIndices) {
if( _probot->DoesAffect(_probot->GetJointFromDOFIndex(dofindex)->GetJointIndex(), ilink)) {
_vLinks.push_back(_probot->GetLinks()[ilink]);
Expand All @@ -86,7 +91,13 @@ By default will sample the robot's active DOFs. Parameters part of the interface
}
}
else {
_vLinks = _probot->GetLinks();
for (const KinBody::LinkPtr& plink: _probot->GetLinks()) {
if( plink->GetGeometries().empty() ) {
// Links that don't have geometries (virtual links) don't matter for jittering. Their AABBs can interfere with the results.
continue;
}
_vLinks.push_back(plink);
}
}
_vLinkAABBs.resize(_vLinks.size());
for(size_t i = 0; i < _vLinks.size(); ++i) {
Expand Down Expand Up @@ -939,9 +950,14 @@ By default will sample the robot's active DOFs. Parameters part of the interface
vector<KinBodyPtr> vgrabbedbodies;
_probot->GetGrabbed(vgrabbedbodies);
// robot itself might have changed?
_vLinks.resize(0);
_vLinks.reserve(_probot->GetLinks().size());
if( _nActiveAffineDOFs == 0 ) {
_vLinks.clear();
for (size_t ilink = 0; ilink < _probot->GetLinks().size(); ++ilink) {
if( _probot->GetLinks()[ilink]->GetGeometries().empty() ) {
// Links that don't have geometries (virtual links) don't matter for jittering. Their AABBs can interfere with the results.
continue;
}
for(int dofindex : _vActiveIndices) {
if( _probot->DoesAffect(_probot->GetJointFromDOFIndex(dofindex)->GetJointIndex(), ilink)) {
_vLinks.push_back(_probot->GetLinks()[ilink]);
Expand All @@ -951,7 +967,13 @@ By default will sample the robot's active DOFs. Parameters part of the interface
}
}
else {
_vLinks = _probot->GetLinks();
for (const KinBody::LinkPtr& plink: _probot->GetLinks()) {
if( plink->GetGeometries().empty() ) {
// Links that don't have geometries (virtual links) don't matter for jittering. Their AABBs can interfere with the results.
continue;
}
_vLinks.push_back(plink);
}
}
FOREACHC(itgrabbed, vgrabbedbodies) {
FOREACHC(itlink2, (*itgrabbed)->GetLinks()) {
Expand Down
7 changes: 5 additions & 2 deletions src/libopenrave-core/xmlreaders-core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,7 @@ class ManipulatorXMLReader : public StreamXMLReader
if( _processingtag.size() > 0 ) {
return PE_Ignore;
}
if (( xmlname == "effector") ||( xmlname == "gripperjoints") ||( xmlname == "joints") ||( xmlname == "armjoints") ||( xmlname == "base") ||( xmlname == "iksolver") ||( xmlname == "closingdir") ||( xmlname == "palmdirection") ||( xmlname=="direction") ||( xmlname == "closingdirection") ||( xmlname == "translation") ||( xmlname == "quat") ||( xmlname == "rotationaxis") ||( xmlname == "rotationmat") || xmlname == "chuckingdirection") {
if (( xmlname == "effector") ||( xmlname == "gripperjoints") ||( xmlname == "joints") ||( xmlname == "armjoints") ||( xmlname == "base") ||( xmlname == "iksolver") ||( xmlname == "closingdir") ||( xmlname == "palmdirection") ||( xmlname=="direction") ||( xmlname == "closingdirection") ||( xmlname == "translation") ||( xmlname == "quat") ||( xmlname == "rotationaxis") ||( xmlname == "rotationmat") || xmlname == "chuckingdirection" || (xmlname == "grippername") ) {
_processingtag = xmlname;
return PE_Support;
}
Expand Down Expand Up @@ -2583,6 +2583,9 @@ class ManipulatorXMLReader : public StreamXMLReader
else if((xmlname == "joints")||(xmlname == "gripperjoints")) {
_manipinfo._vGripperJointNames = vector<string>((istream_iterator<string>(_ss)), istream_iterator<string>());
}
else if( xmlname == "grippername" ) {
_ss >> _manipinfo._grippername;
}
else if( xmlname == "armjoints" ) {
RAVELOG_WARN("<armjoints> for <manipulator> tag is not used anymore\n");
}
Expand Down Expand Up @@ -3504,7 +3507,7 @@ class EnvironmentXMLReader : public StreamXMLReader
_ss >> pluginname;
RaveLoadPlugin(pluginname);
}
else if(xmlname == "unit"){
else if(xmlname == "unit") {
std::pair<std::string, dReal> unit;
_ss >> unit.first >> unit.second;
UnitInfo unitInfo = _penv->GetUnitInfo();
Expand Down