37 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of joint is differ, input:" << jvs.length() <<
", mask:" << mask.length() <<
", robot" << (
unsigned int)(
m_player->
robot()->numJoints()) << std::endl;
45 const OpenHRP::bSequence
mask;
56 if (jvss.length() <= 0) {
57 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of joint angles sequence is invalid:" << jvss.length() <<
" > 0" << std::endl;
60 if (jvss.length() != tms.length()) {
61 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of joint angles sequence and time sequence differ, joint angle:" << jvss.length() <<
", time:" << tms.length() << std::endl;
64 const dSequence& jvs = jvss[0];
70 if (mask.length() > 0 && mask.length() != (
unsigned int)(
m_player->
robot()->numJoints())) {
71 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of joint is differ, input:" << jvs.length() <<
", mask:" << mask.length() <<
", robot" << (
unsigned int)(
m_player->
robot()->numJoints()) << std::endl;
78 CORBA::Boolean
SequencePlayerService_impl::setJointAnglesSequenceFull(
const dSequenceSequence& jvss,
const dSequenceSequence& vels,
const dSequenceSequence& torques,
const dSequenceSequence& poss,
const dSequenceSequence& rpys,
const dSequenceSequence& accs,
const dSequenceSequence& zmps,
const dSequenceSequence& wrenches,
const dSequenceSequence& optionals,
const dSequence &tms)
80 if (jvss.length() <= 0) {
81 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of joint angles sequence is invalid:" << jvss.length() <<
" > 0" << std::endl;
84 if (jvss.length() != tms.length()) {
85 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of joint angles sequence and time sequence differ, joint angle:" << jvss.length() <<
", time:" << tms.length() << std::endl;
88 const dSequence& jvs = jvss[0];
93 if (vels.length() > 0 ) {
94 const dSequence& vel = vels[0];
95 if (vels.length() != tms.length()) {
96 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of joint velocitys sequence and time sequence differ, joint velocity:" << vels.length() <<
", time:" << tms.length() << std::endl;
100 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of joint is differ, input:" << jvs.length() <<
", vel:" << vel.length() <<
", robot" << (
unsigned int)(
m_player->
robot()->numJoints()) << std::endl;
104 if (torques.length() > 0 ) {
105 const dSequence& torque = torques[0];
106 if (torques.length() != tms.length()) {
107 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of joint torque sequence and time sequence differ, joint torque:" << torques.length() <<
", time:" << tms.length() << std::endl;
111 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of joint is differ, input:" << jvs.length() <<
", torque:" << torque.length() <<
", robot" << (
unsigned int)(
m_player->
robot()->numJoints()) << std::endl;
116 if (poss.length() > 0) {
117 const dSequence&
pos = poss[0];
118 if (poss.length() != tms.length()) {
119 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of base pos sequence and time sequence differ, pos:" << poss.length() <<
", time:" << tms.length() << std::endl;
122 if ( pos.length() != 3) {
123 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of base pos is differ, pos:" << pos.length() << std::endl;
128 if (rpys.length() > 0) {
129 const dSequence& rpy = rpys[0];
130 if (rpys.length() != tms.length()) {
131 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of base rpy sequence and time sequence differ, rpy:" << rpys.length() <<
", time:" << tms.length() << std::endl;
134 if ( rpy.length() != 3) {
135 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of base rpy is differ, rpy:" << rpy.length() << std::endl;
140 if (accs.length() > 0 ) {
141 const dSequence& acc = accs[0];
142 if (accs.length() != tms.length()) {
143 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of joint accocitys sequence and time sequence differ, joint accocity:" << accs.length() <<
", time:" << tms.length() << std::endl;
146 if ( acc.length() != 3) {
147 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of joint is differ, input:" << jvs.length() <<
", acc:" << acc.length() <<
", robot" << (
unsigned int)(
m_player->
robot()->numJoints()) << std::endl;
152 if (zmps.length() > 0) {
153 const dSequence& zmp = zmps[0];
154 if (zmps.length() != tms.length()) {
155 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of zmp sequence and time sequence differ, zmp:" << zmps.length() <<
", time:" << tms.length() << std::endl;
158 if ( zmp.length() != 3) {
159 std::cerr <<
__PRETTY_FUNCTION__ <<
" num of zmp is differ, zmp:" << zmp.length() << std::endl;
164 if (wrenches.length() > 0) {
165 if (wrenches.length() != tms.length()) {
166 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of wrench sequence and time sequence differ, wrench:" << wrenches.length() <<
", time:" << tms.length() << std::endl;
173 if (optionals.length() > 0) {
174 if (optionals.length() != tms.length()) {
175 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of optional sequence and time sequence differ, optional:" << optionals.length() <<
", time:" << tms.length() << std::endl;
188 Link *
l = r->link(jname);
190 std::cerr <<
"can't find(" << jname <<
")" << std::endl;
199 if (pos.length() != 3)
return false;
206 if (rpy.length() != 3)
return false;
213 if (zmp.length() != 3)
return false;
226 char* frame_name = (
char *)strrchr(gname,
':');
228 ((
char *)gname)[frame_name - gname] =
'\0';
242 std::cerr <<
"player is not set"<< std::endl;
302 if (jvss.length() != tms.length()) {
303 std::cerr <<
__PRETTY_FUNCTION__ <<
" length of joint angles sequence and time sequence differ, joint angle:" << jvss.length() <<
", time:" << tms.length() << std::endl;
bool setTargetPose(const char *gname, const double *xyz, const double *rpy, double tm, const char *frame_name)
CORBA::Boolean removeJointGroup(const char *gname)
CORBA::Boolean setTargetPose(const char *gname, const dSequence &xyz, const dSequence &rpy, CORBA::Double tm)
CORBA::Boolean setJointAnglesSequence(const dSequenceSequence &jvs, const dSequence &tms)
bool setJointAnglesSequenceFull(const OpenHRP::dSequenceSequence i_jvss, const OpenHRP::dSequenceSequence i_vels, const OpenHRP::dSequenceSequence i_torques, const OpenHRP::dSequenceSequence i_poss, const OpenHRP::dSequenceSequence i_rpys, const OpenHRP::dSequenceSequence i_accs, const OpenHRP::dSequenceSequence i_zmps, const OpenHRP::dSequenceSequence i_wrenches, const OpenHRP::dSequenceSequence i_optionals, const dSequence i_tms)
CORBA::Boolean setJointAngles(const dSequence &jvs, CORBA::Double tm)
virtual ~SequencePlayerService_impl()
bool setWrenches(const double *wrenches, double tm)
CORBA::Boolean setJointAnglesSequenceFull(const dSequenceSequence &jvss, const dSequenceSequence &vels, const dSequenceSequence &torques, const dSequenceSequence &poss, const dSequenceSequence &rpys, const dSequenceSequence &accs, const dSequenceSequence &zmps, const dSequenceSequence &wrenches, const dSequenceSequence &optionals, const dSequence &tms)
bool setZmp(const double *zmp, double tm)
sequence player component
void playPattern(const dSequenceSequence &pos, const dSequenceSequence &rpy, const dSequenceSequence &zmp, const dSequence &tm)
bool setJointAngles(const double *angles, double tm)
SequencePlayer * m_player
CORBA::Boolean setZmp(const dSequence &zmp, CORBA::Double tm)
void player(SequencePlayer *i_player)
std::string basename(const std::string name)
bool setJointAnglesSequence(const OpenHRP::dSequenceSequence angless, const OpenHRP::bSequence &mask, const OpenHRP::dSequence ×)
bool removeJointGroup(const char *gname)
CORBA::Boolean setJointAnglesOfGroup(const char *gname, const dSequence &jvs, CORBA::Double tm)
void loadPattern(const char *basename, CORBA::Double tm)
void loadPattern(const char *basename, double time)
bool addJointGroup(const char *gname, const OpenHRP::SequencePlayerService::StrSequence &jnames)
bool setJointAnglesSequenceOfGroup(const char *gname, const OpenHRP::dSequenceSequence angless, const OpenHRP::dSequence ×)
bool setBaseRpy(const double *rpy, double tm)
void clearOfGroup(const char *gname, double i_timeLimit)
bool setBasePos(const double *pos, double tm)
CORBA::Boolean waitInterpolationOfGroup(const char *gname)
bool waitInterpolationOfGroup(const char *gname)
bool clearJointAnglesOfGroup(const char *gname)
CORBA::Boolean setJointAnglesSequenceWithMask(const dSequenceSequence &jvs, const bSequence &mask, const dSequence &tms)
png_infop int png_uint_32 mask
CORBA::Boolean setInterpolationMode(OpenHRP::SequencePlayerService::interpolationMode i_mode_)
void playPattern(const OpenHRP::dSequenceSequence &pos, const OpenHRP::dSequenceSequence &rpy, const OpenHRP::dSequenceSequence &zmp, const OpenHRP::dSequence &tm)
CORBA::Boolean clearJointAngles()
void setMaxIKIteration(short iter)
CORBA::Boolean setJointAngle(const char *jname, CORBA::Double jv, CORBA::Double tm)
void clear(double i_timeLimit=0)
CORBA::Boolean addJointGroup(const char *gname, const OpenHRP::SequencePlayerService::StrSequence &jnames)
void setMaxIKIteration(CORBA::Short iter)
#define __PRETTY_FUNCTION__
void setMaxIKError(double pos, double rot)
CORBA::Boolean setWrenches(const dSequence &wrenches, CORBA::Double tm)
bool setJointAngle(short id, double angle, double tm)
void setMaxIKError(CORBA::Double pos, CORBA::Double rot)
bool setJointAnglesOfGroup(const char *gname, const OpenHRP::dSequence &jvs, double tm)
bool setInitialState(double tm=0.0)
bool setInterpolationMode(OpenHRP::SequencePlayerService::interpolationMode i_mode_)
SequencePlayerService_impl()
CORBA::Boolean setInitialState()
CORBA::Boolean clearOfGroup(const char *gname, CORBA::Double i_timelimit)
bool playPatternOfGroup(const char *gname, const OpenHRP::dSequenceSequence &pos, const OpenHRP::dSequence &tm)
CORBA::Boolean playPatternOfGroup(const char *gname, const dSequenceSequence &pos, const dSequence &tm)
CORBA::Boolean setJointAnglesWithMask(const dSequence &jvs, const bSequence &mask, CORBA::Double tm)
CORBA::Boolean clearJointAnglesOfGroup(const char *gname)
CORBA::Boolean setBasePos(const dSequence &pos, CORBA::Double tm)
CORBA::Boolean setJointAnglesSequenceOfGroup(const char *gname, const dSequenceSequence &jvs, const dSequence &tms)
CORBA::Boolean setBaseRpy(const dSequence &rpy, CORBA::Double tm)