13 #define deg2rad(x) ( 3.14159265358979 / 180*(x) ) 16 main(
int argc,
char* argv[])
19 string url =
"file://";
21 for(i=0; i < argc; i++) {
22 if( strcmp(argv[i],
"-url") == 0 && i+1 < argc) url += argv[i+1];
28 cerr <<
"ModelLoader: " << url <<
" cannot be loaded" << endl;
32 body->calcForwardKinematics();
37 olv->load(body->modelName().c_str(), url.c_str());
38 olv->setLogName(
"move_ankle");
39 }
catch (CORBA::SystemException& ex) {
40 cerr <<
"Failed to connect GrxUI." << endl;
45 body->joint(1)->q =
deg2rad(-10);
46 body->joint(3)->q =
deg2rad(20);
47 body->joint(4)->q =
deg2rad(-10);
48 body->calcForwardKinematics();
51 Link* waist = body->link(
"WAIST");
52 Link* ankle = body->link(
"RLEG_ANKLE_R");
57 world.characterPositions.length(1);
58 world.collisions.length(0);
62 CharacterPosition& robot = world.characterPositions[0];
63 robot.characterName = CORBA::string_dup(
"SampleRobot");
78 if (!path->calcInverseKinematics(p, R)) {
83 int n = body->numLinks();
84 robot.linkPositions.length(n);
85 for (
int i=0; i<
n; i++) {
86 Link* link = body->link(i);
94 }
catch (CORBA::SystemException& ex) {
95 std::cerr <<
"OnlineViewer could not be updated." << endl;
The header file of the LinkTraverse class.
void setVector3(const Vector3 &v3, V &v, size_t top=0)
boost::shared_ptr< Body > BodyPtr
void setMatrix33ToRowMajorArray(const Matrix33 &m33, Array &a, size_t top=0)
The header file of the LinkPath and JointPath classes.
int main(int argc, char *argv[])
boost::shared_ptr< JointPath > JointPathPtr
HRP_UTIL_EXPORT OpenHRP::OnlineViewer_var getOnlineViewer(int argc, char **argv)
HRPMODEL_API bool loadBodyFromModelLoader(BodyPtr body, const char *url, CORBA_ORB_var orb, bool loadGeometryForCollisionDetection=false)