141 name =
new char [strlen(_name) + 1];
144 if(charname) *charname =
'\0';
153 SetFixedJointType(rpos, ratt);
156 SetRotateJointType(rpos, ratt, ai);
159 SetSlideJointType(rpos, ratt, ai);
162 SetSphereJointType(rpos, ratt);
165 SetFreeJointType(rpos, ratt);
183 name =
new char [strlen(jdata->
name) + strlen(charname) + 2];
190 name =
new char [strlen(jdata->
name) + 1];
202 loc_com.set(jdata->
com);
230 if(realname)
delete[] realname;
240 ratt_real.identity();
296 if(realname)
delete[] realname;
297 if(brother)
delete brother;
298 if(child)
delete child;
306 name =
new char [strlen(jdata->
name) + 1];
311 loc_com.set(jdata->
com);
343 cerr <<
"Chain::GetJointNameList - error: cannot be called between BeginCreateChain() and EndCreateChain()" << endl;
358 jnames[i_joint] =
new char [strlen(
name) + 1];
359 strcpy(jnames[i_joint],
name);
361 child->get_joint_name_list(jnames);
362 brother->get_joint_name_list(jnames);
370 cerr <<
"Chain::GetJointList - error: cannot be called between BeginCreateChain() and EndCreateChain()" << endl;
383 if(i_joint >= 0 && !real)
385 joints[i_joint] =
this;
388 brother->get_joint_list(joints);
403 && !strcmp(mych, charname))
return this;
407 if(!strcmp(
name, n))
return this;
410 if((ret = child->
find_joint(n, charname)))
return ret;
411 if((ret = brother->
find_joint(n, charname)))
return ret;
422 if(i_joint == _id)
return this;
424 if((ret = child->
find_joint(_id)))
return ret;
425 if((ret = brother->
find_joint(_id)))
return ret;
436 if(ch && !strcmp(ch, charname))
return j;
443 return child->descendant_dof();
448 int ret1 = brother->descendant_dof();
449 int ret2 = child->descendant_dof();
450 return (ret1 + ret2 +
n_dof);
455 return (1+child->descendant_num_joints());
460 int ret1 = brother->descendant_num_joints();
461 int ret2 = child->descendant_num_joints();
462 return (ret1 + ret2 + 1);
467 return is_descendant(child, target);
472 if(!cur)
return false;
473 if(cur == target)
return true;
474 if(is_descendant(cur->
brother, target))
return true;
475 if(is_descendant(cur->
child, target))
return true;
482 for(p=
this; p; p=p->
parent)
484 if(p == target)
return true;
Joint * child
pointer to the child joint
int SetJointValue(const fVec &values)
Set all joint values.
void clear(CorbaSequence &seq)
JointType j_type
joint type
void get_joint_name_list(char **jnames)
char * CharName(const char *_name)
Extracts the character name from a joint name.
int GetJointNameList(char **&jnames)
Obtain a list of joint names.
int SetStatus(const fVec &value, const fVec &vel, const fVec &acc)
Set current joint values, velocities, and accelerations.
int isAscendant(Joint *target)
Identifies whether the target joint is a direct ascendant.
void clear_scale_object_list()
int in_create_chain
true if between BeginCreateChain() and EndCreateChain().
int is_descendant(Joint *cur, Joint *target)
png_infop png_charpp name
fMat33 rel_att
initial orientation in parent joint's frame
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
Joint * root
Chain information.
int SetJointAcc(const fVec &accs)
double * j_value_dot[4]
for 4-th order Runge-Kutta
fVec3 com
link center of mass in local frame
static char charname_separator
int GetJointVel(fVec &vels)
void SetJointData(JointData *jdata, const char *charname)
int isDescendant(Joint *target)
Identifies whether the target joint is a direct descendant.
int SetJointVel(const fVec &vels)
Set all joint velocities/accelerations.
int DescendantNumJoints()
Total number of joints of the descendants (end link side).
int n_thrust
total DOF of the joints with t_given = false
Joint * find_joint(const char *n, const char *charname)
int SaveStatus(fVec &value, fVec &vel, fVec &acc)
Save current joint values, velocities, and accelerations.
int GetJointAcc(fVec &accs)
int descendant_num_joints()
std::string basename(const std::string name)
double ** all_value
Pointers to the integration variables.
void get_joint_list(Joint **joints)
int do_connect
true after Connect() was called; application (or subclass) must reset the flag
fMat33 inertia
link inertia
void resize(int i)
Change the size.
Joint * brother
pointer to the brother joint
Classes for defining open/closed kinematic chains.
int DescendantDOF()
Total DOF of the descendants (end link side).
std::string sprintf(char const *__restrict fmt,...)
char * CharName() const
Returns the character name.
Temporary storage for basic joint information.
int GetJointValue(fVec &values)
Obtain the joint values/velocities/accelerations.
int GetJointList(Joint **&joints)
Obtain a list of pointers to all joints.
JointType
Enums for joint types.
AxisIndex
Direction of a 1-DOF joint.
Joint * FindJoint(const char *jname, const char *charname=0)
Find a joint from name.
The class for representing a joint.
fVec3 rel_pos
initial position in parent joint's frame
Joint * parent
pointer to the parent joint
virtual void Clear()
Remove all joints and clear all parameters.
int t_given
if true, the joint is torque controlled, otherwise position controlled (high-gain control) ...
AxisIndex axis_index
direction of the joint axis (only for 1DOF joints)
Joint * FindCharacterRoot(const char *charname)
Find the root joint of the character with name charname.