AGXMagneticJoint¶
Sample¶
The sample is below. When loading the sample project with Choreonoid and running the simulation, you can see the blue object stick together with the red object automatically (see above figure).
project file: chorenoid/sample/AGXDynamics/agxMagneticJoint.cnoid
body file: chorenoid/sample/AGXDynamics/agxMagneticJoint.body
How to write¶
AGX Magnetic Joint can be described and used as follows.
links:
-
name: Plug
elements:
-
type: AGXMagneticJointDevice
link1Name: Socket
link2Name: Plug
position1: [ 0, 0.25, 0 ]
position2: [ 0, 0, -0.05 ]
connectAxis1: [ 0, 1, 0 ]
connectAxis2: [ 0, 0, 1 ]
jointCompliance: 1e-6
jointSpookDamping: 1.0
validDistance: 1.0
validAngle: 20
Set the links to connect with AGXMagneticJoint in linkName
Set which part of the link to connect in position and connectAxis
Set the force and speed of connection in jointCompliance and jointSpookDamping
Set the distance and angle at which connection becomes valid in validDistance and validAngle
position is the relative position from the link coordinate system, and connectAxis is the connection direction of the joint. For example, if you set each connectAxis to different directions as shown in the left figure below, the connection is made so that each connectAxis aligns.
Explanation of parameters¶
The parameters are described below.
parameter |
default value |
unit |
default value |
explanation |
|---|---|---|---|---|
type: AGXMagneticJointDevice |
- |
- |
string |
declaration of using AGXMagneticJoint |
link1Name |
- |
- |
string |
name of the link1 |
link2Name |
- |
- |
string |
name of the link2 |
position1 |
[0, 0, 0] |
- |
Vec3 |
position of the joint relative from the link1 coordinate |
position2 |
[0, 0, 0] |
- |
Vec3 |
position of the joint relative from the link2 coordinate |
connectAxis1 |
[0, 0, 1] |
- |
Unit Vec3 |
direction of the joint relative from the link1 coordinate |
connectAxis2 |
[0, 0, 1] |
- |
Unit Vec3 |
direction of the joint relative from the link2 coordinate |
jointCompliance |
1e-8 |
m/N |
double |
compliance of the joint |
jointSpookDamping |
0.33 |
s |
double |
spook damping of the joint |
validDistance |
0 |
m |
double |
distance threshold when the magnetic joint effective |
validAngle |
0 |
degree |
double |
angle threshold when the magnetic joint effective |