Actin®  Version 5.3.0
Software for Robotics Simulation and Control
Creating Custom Joint Types (Link Kinematics)

get the general motion of the frame (locally represented).

Introduction

We can define a custom link kinematics for a link and define its behavior and use it as a link for a manipulator and let Actin use the custom link kinematics that we were defined the custom class. Here we will explain the process on how we can achieve it using Actin SDK.

Step 1

First we have to derive our custom class from EcLinkKinematics and define the required behavior in methods calculateAcceleration & calculateVelocity and implement the other methods from base class as needed.

class EC_EXAMPLES_CUSTOMTYPELINK_DECL EcCustomTypeLink : public EcLinkKinematics
{
public:
enum { ROTATIONAL, PRISMATIC };
(
);
virtual void registerDrivingTypeEnumerations
(
);
virtual void registerComponents
(
);
static EcXmlObject* creator
(
);
virtual EcU32 drivingType
(
) const;
virtual void setDrivingType
(
EcU32 value
);
virtual const EcCoordinateSystemTransformation& precursor
(
) const;
virtual void setPrecursor
(
);
virtual EcReal pitch
(
) const;
virtual void setPitch
(
EcReal pitch
);
(
EcReal jointValue
) const;
virtual void transformBy
(
EcReal jointValue
) const;
virtual void getUnitFrameMotion
(
EcGeneralMotion& frameVelocity,
EcReal jointValue
) const;
(
EcReal jointValue,
EcReal jointVelocity
) const;
(
EcReal jointValue,
EcReal jointVelocity,
EcReal jointAcceleration
) const;
(
const EcCustomTypeLink& dh2,
EcReal tol
) const;
(
const EcJointActuator& jointActuator
) const;
virtual void scaleBy
(
EcReal scaleFactor
);
virtual void transformBy
(
);
(
)const;
virtual void changeInboardFrameBy
(
);
virtual EcBoolean read
(
EcXmlReader& stream
);
virtual EcBoolean write
(
EcXmlWriter& stream
) const;
virtual EcU32 unitType
(
) const;
static EcCustomTypeLink nullObject
(
);
protected:
EcXmlEnumU32 m_DrivingType;
EcXmlReal m_Pitch;
mutable EcReal m_JointValueForStoredTransform;
mutable EcBoolean m_StoredTransformValid;
};
#endif // ecCustomTypeLink_H_

Step 2

We have to export this EcCustomLinkKinemtics class has to be registered as XML object so that we can load that when defining EcManipulatorLink. So for this we have to define the custom class using ecXmlObjectLibraryAndPlugin macro in CMakeLists

ecXmlObjectLibraryAndPlugin(
## Mention your class name
EcCustomLinkKinemtics
)

This will create the linkable libraries which can used when defining the manipualtor links.

Step 3

Now when defining the EcManipulatorLink, we have to add the custom library so that it will be loaded when the link is being created. This can done using the below lines

EcXmlStringVector addLibraries;
addLibraries.pushBack(EcXmlString("customLinkKinematics"));
container.setAddLibraries(addLibraries);
link.setShape(extent);
// set the Denavit-Hartenberg link kinematics data
clink.setDrivingType(EcCustomTypeLink::ROTATIONAL);
clink.setPitch(5.0);
link.setLinkKinematics(clink);
// set the actuator
// set the label
link.setLinkLabel("link1");

Step 4

We can cross check whether the custom library is loaded by saving the manipulator as xml file and seeing its contents and it should look something similar like below which has the library name that need to loaded for the manipulator link

1 <linkKinematicsContainer>
2  <addLibraries size="1">
3  <element>customLinkKinematics</element>
4  </addLibraries>
5  <ci:customLinkType xmlns:ci="http://www.energid.com/namespace/ci" library="customLinkKinematics.ecp">
6  <ci:jointType>jointTypeRotation</ci:jointType>
7  <ci:pitch>5</ci:pitch>
8  <ci:precursor>
9  <cr:orientation xmlns:cr="http://www.energid.com/namespace/cr" q0=".7071067811865476" q1="0" q2=".7071067811865475" q3="0"/>
10  <translation x="0" y="0" z="0"/>
11  </ci:precursor>
12  <primaryFrame>
13  <cr:orientation xmlns:cr="http://www.energid.com/namespace/cr" q0="1" q1="0" q2="0" q3="0"/>
14  <translation x="0" y="0" z="0"/>
15  </primaryFrame>
16  </ci:customLinkType>
17  </linkKinematicsContainer>

The detailed example is provided with Actin SDK and can be found in toolkits/examples

customLinkKinematics - Defines a EcCustomTypeLink

customManipulator - Creates a link and uses this EcCustomTypeLink

Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.