19 #ifndef ROBOTIS_MANIPULATOR_COMMON_H 20 #define ROBOTIS_MANIPULATOR_COMMON_H 23 #if defined(__OPENCR__) 28 #include <eigen3/Eigen/Eigen> 29 #include <eigen3/Eigen/LU> 112 bool setEffortToValue(std::vector<JointValue> *value, std::vector<double> effort);
217 void addWorld(Name world_name,
219 Eigen::Vector3d world_position = Eigen::Vector3d::Zero(),
220 Eigen::Matrix3d world_orientation = Eigen::Matrix3d::Identity());
222 void addJoint(Name my_name,
225 Eigen::Vector3d relative_position,
226 Eigen::Matrix3d relative_orientation,
227 Eigen::Vector3d axis_of_rotation = Eigen::Vector3d::Zero(),
228 int8_t joint_actuator_id = -1,
229 double max_position_limit = M_PI,
230 double min_position_limit = -M_PI,
231 double coefficient = 1.0,
233 Eigen::Matrix3d inertia_tensor = Eigen::Matrix3d::Identity(),
234 Eigen::Vector3d center_of_mass = Eigen::Vector3d::Zero(),
235 double torque_coefficient = 1.0);
237 void addTool(Name my_name,
239 Eigen::Vector3d relative_position,
240 Eigen::Matrix3d relative_orientation,
242 double max_position_limit = M_PI,
243 double min_position_limit = -M_PI,
244 double coefficient = 1.0,
246 Eigen::Matrix3d inertia_tensor = Eigen::Matrix3d::Identity(),
247 Eigen::Vector3d center_of_mass = Eigen::Vector3d::Zero(),
248 double torque_coefficient = 1.0);
250 void addComponentChild(Name my_name, Name child_name);
251 void printManipulatorSetting();
257 void setTorqueCoefficient(Name component_name,
double torque_coefficient);
259 void setWorldPose(Pose world_pose);
260 void setWorldKinematicPose(
KinematicPose world_kinematic_pose);
261 void setWorldPosition(Eigen::Vector3d world_position);
262 void setWorldOrientation(Eigen::Matrix3d world_orientation);
263 void setWorldDynamicPose(
DynamicPose world_dynamic_pose);
264 void setWorldLinearVelocity(Eigen::Vector3d world_linear_velocity);
265 void setWorldAngularVelocity(Eigen::Vector3d world_angular_velocity);
266 void setWorldLinearAcceleration(Eigen::Vector3d world_linear_acceleration);
267 void setWorldAngularAcceleration(Eigen::Vector3d world_angular_acceleration);
268 void setComponent(Name component_name,
Component component);
269 void setComponentActuatorName(Name component_name, Name actuator_name);
270 void setComponentPoseFromWorld(Name component_name, Pose pose_to_world);
271 void setComponentKinematicPoseFromWorld(Name component_name,
KinematicPose pose_to_world);
272 void setComponentPositionFromWorld(Name component_name, Eigen::Vector3d position_to_world);
273 void setComponentOrientationFromWorld(Name component_name, Eigen::Matrix3d orientation_to_wolrd);
274 void setComponentDynamicPoseFromWorld(Name component_name,
DynamicPose dynamic_pose);
276 void setJointPosition(Name name,
double position);
277 void setJointVelocity(Name name,
double velocity);
278 void setJointAcceleration(Name name,
double acceleration);
279 void setJointEffort(Name name,
double effort);
280 void setJointValue(Name name, JointValue joint_value);
282 void setAllActiveJointPosition(std::vector<double> joint_position_vector);
283 void setAllActiveJointValue(std::vector<JointValue> joint_value_vector);
284 void setAllJointPosition(std::vector<double> joint_position_vector);
285 void setAllJointValue(std::vector<JointValue> joint_value_vector);
286 void setAllToolPosition(std::vector<double> tool_position_vector);
287 void setAllToolValue(std::vector<JointValue> tool_value_vector);
295 Name getWorldChildName();
298 Eigen::Vector3d getWorldPosition();
299 Eigen::Matrix3d getWorldOrientation();
301 int8_t getComponentSize();
302 std::map<Name, Component> getAllComponent();
303 std::map<Name, Component>::iterator getIteratorBegin();
304 std::map<Name, Component>::iterator getIteratorEnd();
305 Component getComponent(Name component_name);
306 Name getComponentActuatorName(Name component_name);
307 Name getComponentParentName(Name component_name);
308 std::vector<Name> getComponentChildName(Name component_name);
309 Pose getComponentPoseFromWorld(Name component_name);
310 KinematicPose getComponentKinematicPoseFromWorld(Name component_name);
311 Eigen::Vector3d getComponentPositionFromWorld(Name component_name);
312 Eigen::Matrix3d getComponentOrientationFromWorld(Name component_name);
313 DynamicPose getComponentDynamicPoseFromWorld(Name component_name);
314 KinematicPose getComponentRelativePoseFromParent(Name component_name);
315 Eigen::Vector3d getComponentRelativePositionFromParent(Name component_name);
316 Eigen::Matrix3d getComponentRelativeOrientationFromParent(Name component_name);
318 int8_t getId(Name component_name);
319 double getCoefficient(Name component_name);
320 double getTorqueCoefficient(Name component_name);
321 Eigen::Vector3d getAxis(Name component_name);
322 double getJointPosition(Name component_name);
323 double getJointVelocity(Name component_name);
324 double getJointAcceleration(Name component_name);
325 double getJointEffort(Name component_name);
326 JointValue getJointValue(Name component_name);
328 double getComponentMass(Name component_name);
329 Eigen::Matrix3d getComponentInertiaTensor(Name component_name);
330 Eigen::Vector3d getComponentCenterOfMass(Name component_name);
332 std::vector<double> getAllJointPosition();
333 std::vector<JointValue> getAllJointValue();
334 std::vector<double> getAllActiveJointPosition();
335 std::vector<JointValue> getAllActiveJointValue();
336 std::vector<double> getAllToolPosition();
337 std::vector<JointValue> getAllToolValue();
339 std::vector<uint8_t> getAllJointID();
340 std::vector<uint8_t> getAllActiveJointID();
341 std::vector<Name> getAllToolComponentName();
342 std::vector<Name> getAllActiveJointComponentName();
348 bool checkJointLimit(Name Component_name,
double value);
349 bool checkComponentType(Name component_name, ComponentType component_type);
355 Name findComponentNameUsingId(int8_t
id);
359 #endif // ROBOTIS_MANIPULATOR_COMMON_H struct robotis_manipulator::_DynamicPose DynamicPose
enum robotis_manipulator::_TrajectoryType TrajectoryType
struct robotis_manipulator::_Point ToolValue
struct robotis_manipulator::_Limit Limit
struct robotis_manipulator::_World World
bool setEffortToValue(std::vector< JointValue > *value, std::vector< double > effort)
std::vector< Name > child
struct robotis_manipulator::_Object Object
struct robotis_manipulator::_Time Time
struct robotis_manipulator::_Component Component
std::vector< JointValue > JointWaypoint
Eigen::Vector3d center_of_mass
struct robotis_manipulator::_ChainingName ChainingName
Eigen::Matrix3d inertia_tensor
struct robotis_manipulator::_TaskWaypoint Pose
struct robotis_manipulator::_Relative Relative
std::map< Name, Component > component_
struct robotis_manipulator::_Force Force
struct robotis_manipulator::_Dynamicvector Dynamicvector
struct robotis_manipulator::_JointConstant JointConstant
enum robotis_manipulator::_ComponentType ComponentType
ComponentType component_type
struct robotis_manipulator::_Point JointValue
struct robotis_manipulator::_Moment Moment
struct robotis_manipulator::_Point ActuatorValue
struct robotis_manipulator::_KinematicPose KinematicPose
struct robotis_manipulator::_Inertia Inertia
Eigen::Vector3d acceleration
double torque_coefficient
bool setPositionToValue(std::vector< JointValue > *value, std::vector< double > position)
JointConstant joint_constant
KinematicPose pose_from_parent
Eigen::Matrix3d orientation
struct robotis_manipulator::_Point Point
struct robotis_manipulator::_TaskWaypoint TaskWaypoint