17 package com.generalrobotix.ui.view.tdview;
19 import javax.media.j3d.Transform3D;
20 import javax.media.j3d.TransformGroup;
21 import javax.vecmath.*;
41 private LinkPosition
tr;
52 trFrom_ =
new Transform3D();
53 tr =
new LinkPosition();
59 integrator_ = integrator;
72 }
else if(robot_ != model) {
80 TransformGroup tg = from_.
tg_;
81 Transform3D tr =
new Transform3D();
83 tg.getLocalToVworld(trFrom_);
100 }
else if(robot_ != model) {
120 Transform3D t3d =
new Transform3D();
121 tg.getTransform(t3d);
122 Vector3d pos =
new Vector3d();
123 Matrix3d mat =
new Matrix3d();
126 double[]
value =
new double[12];
138 integrator_.setCharacterLinkData(
141 integrator_.setCharacterAllLinkData(
144 integrator_.calcCharacterForwardKinematics(objectName);
155 public boolean resolve(Transform3D transform) {
158 Matrix3d m3d =
new Matrix3d();
159 Vector3d v3d =
new Vector3d();
160 transform.get(m3d, v3d);
163 for (
int i=0;
i<3;
i++) {
164 for (
int j=0;
j<3;
j++) {
165 tr.R[3*
i+
j] = m3d.getElement(
i,
j);
173 System.out.println(
"ik failed.");
177 }
catch (Exception e) {
181 DblSequenceHolder v =
new DblSequenceHolder();
182 integrator_.getCharacterAllLinkData(robot_.
getName(), LinkDataType.JOINT_VALUE, v);
193 Transform3D t3d =
new Transform3D();
194 from_.
tg_.getTransform(t3d);
196 Transform3D t3dFromNew =
new Transform3D();
197 from_.
tg_.getLocalToVworld(t3dFromNew);
201 Transform3D t3dRoot =
new Transform3D();
203 t3d.mul(trFrom_, t3dFromNew);
206 Matrix3d rot =
new Matrix3d();
207 Vector3d pos =
new Vector3d();
GrxPluginManager manager_
void setJointValuesWithinLimit()
modify joint value if it exceeds limit values
boolean resolve(Transform3D transform)
void updateInitialTransformRoot()
update initial transformation property from current Transform3D
void updateInitialJointValues()
#define null
our own NULL pointer
GrxBaseItem getItem(Class<?extends GrxBaseItem > cls, String name)
TransformGroup getTransformGroupRoot()
boolean setToJoint(GrxModelItem model, GrxLinkItem link)
item corresponds to a robot model
DynamicsSimulator integrator_
boolean setFromJoint(GrxModelItem model, GrxLinkItem link)
InvKinemaResolver(GrxPluginManager manager)
GrxLinkItem rootLink()
get root link
def j(str, encoding="cp932")
void setTransformRoot(Vector3d pos, Matrix3d rot)
set transformation of the root joint
void calcForwardKinematics()
compute forward kinematics
void _setLinkStatus(String objectName)
void _setRootJoint(GrxModelItem robot)
void setJointValues(final double[] values)
set joint values
プラグイン管理クラス GrxUIの核になるクラス。プラグインのロード等の、初期化を実行する。 プラグインとそ...
double[] getJointValues()
final String getName()
get name
void setDynamicsSimulator(DynamicsSimulator integrator)