Skip to content

Commit

Permalink
Add legacy chucking direction. This is only used to keep the value fr…
Browse files Browse the repository at this point in the history
…om the legacy file format and to expose this to json for further post processing.
  • Loading branch information
Shunichi Nozawa committed Apr 20, 2024
1 parent adcfb92 commit ed8432f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/openrave/robot.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class OPENRAVE_API RobotBase : public KinBody
std::string _sBaseLinkName, _sIkChainEndLinkName, _sEffectorLinkName; ///< name of the base and effector links of the robot used to determine the chain
Transform _tLocalTool;
std::vector<int> _vChuckingDirection; ///< the normal direction to move joints for the hand to grasp something
std::vector<int> _vChuckingDirectionLegacy; ///< _vChuckingDirection comes from the legacy file, e.g. collada. This is only used to keep the value from the legacy file format and to expose this to json for further post processing.
Vector _vdirection = Vector(0,0,1);
std::string _sIkSolverXMLId; ///< xml id of the IkSolver interface to attach
std::vector<std::string> _vGripperJointNames; ///< names of the gripper joints
Expand Down
1 change: 1 addition & 0 deletions src/libopenrave-core/colladaparser/colladareader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3526,6 +3526,7 @@ class ColladaReader : public daeErrorHandler
}
}
manipinfo._vChuckingDirection.push_back((dReal)chucking_direction);
manipinfo._vChuckingDirectionLegacy.push_back((dReal)chucking_direction);
}
}
continue;
Expand Down
4 changes: 4 additions & 0 deletions src/libopenrave/robotmanipulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void RobotBase::ManipulatorInfo::Reset()
_vdirection = Vector(0,0,1);
_sIkSolverXMLId.clear();
_vGripperJointNames.clear();
_vChuckingDirectionLegacy.clear();
_grippername.clear();
_toolChangerConnectedBodyToolName.clear();
_toolChangerLinkName.clear();
Expand All @@ -46,6 +47,9 @@ void RobotBase::ManipulatorInfo::SerializeJSON(rapidjson::Value& value, rapidjso
orjson::SetJsonValueByKey(value, "effectorLinkName", _sEffectorLinkName, allocator);
orjson::SetJsonValueByKey(value, "ikSolverType", _sIkSolverXMLId, allocator);
orjson::SetJsonValueByKey(value, "gripperJointNames", _vGripperJointNames, allocator);
if( _vChuckingDirectionLegacy.size() > 0 ) {
orjson::SetJsonValueByKey(value, "chuckingDirections", _vChuckingDirectionLegacy, allocator);
}
orjson::SetJsonValueByKey(value, "grippername", _grippername, allocator);
orjson::SetJsonValueByKey(value, "toolChangerConnectedBodyToolName", _toolChangerConnectedBodyToolName, allocator);
orjson::SetJsonValueByKey(value, "toolChangerLinkName", _toolChangerLinkName, allocator);
Expand Down

0 comments on commit ed8432f

Please sign in to comment.