本文整理汇总了C++中Skeleton::getMass方法的典型用法代码示例。如果您正苦于以下问题:C++ Skeleton::getMass方法的具体用法?C++ Skeleton::getMass怎么用?C++ Skeleton::getMass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skeleton
的用法示例。
在下文中一共展示了Skeleton::getMass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
// google::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging((const char*)argv[0]);
// Define logging flag
FLAGS_alsologtostderr = true;
FLAGS_minloglevel = google::INFO;
#ifndef _DEBUG
FLAGS_log_dir = "./glog/";
#endif
LOG(INFO) << "BioloidGP program begins...";
srand( (unsigned int) time (NULL) );
DecoConfig::GetSingleton()->Init("../config.ini");
World* myWorld = new World;
myWorld->setTimeStep(0.017);
// // Load ground and Atlas robot and add them to the world
DartLoader urdfLoader;
Skeleton* ground = urdfLoader.parseSkeleton(
DATA_DIR"/sdf/ground.urdf");
Skeleton* robot
= urdfLoader.parseSkeleton(
DATA_DIR"/urdf/BioloidGP/BioloidGP.URDF");
robot->enableSelfCollision();
//dart::simulation::World* testWorld
// = dart::utils::SkelParser::readWorld("../../data/skel/fullbody1.skel");
Skeleton* mocapSkel = ReadCMUSkeleton("../../mocap/oneFootBalance.asf");
myWorld->addSkeleton(robot);
myWorld->addSkeleton(ground);
myWorld->addSkeleton(mocapSkel);
AddMarkers(mocapSkel, robot);
// Print some info
LOG(INFO) << "robot.mass = " << robot->getMass();
// Set gravity of the world
myWorld->setGravity(Eigen::Vector3d(0.0, -9.81, 0.0));
//AddWeldConstraint(myWorld);
// Create a humanoid controller
bioloidgp::robot::HumanoidController* con =
new bioloidgp::robot::HumanoidController(robot, myWorld->getConstraintSolver());
//Eigen::VectorXd q6 = Eigen::VectorXd::Zero(6);
//q6[4] = 0;
//con->setFreeDofs(q6);
// Create a window and link it to the world
// MyWindow window(new Controller(robot, myWorld->getConstraintSolver()));
MocapReader mocapReader;
string fileName;
DecoConfig::GetSingleton()->GetString("Mocap", "OriginalFileName", fileName);
mocapReader.Read(fileName);
fileName.replace(fileName.length() - 4, 4, ".state");
SupportInfo supportInfo(fileName);
supportInfo.SetSkeletons(mocapSkel, con->robot());
//supportInfo.SetLeftGlobal(0.1 * Eigen::Vector3d(0, 0, 1));
supportInfo.SetLeftGlobal( 0.1 * Eigen::Vector3d(-1, 0, 0));
MyWindow window(con);
window.setWorld(myWorld);
window.setMocap(&mocapReader);
window.setSupportInfo(&supportInfo);
// Print manual
LOG(INFO) << "space bar: simulation on/off";
LOG(INFO) << "'p': playback/stop";
LOG(INFO) << "'[' and ']': play one frame backward and forward";
LOG(INFO) << "'v': visualization on/off";
LOG(INFO) << endl;
// Run glut loop
glutInit(&argc, argv);
window.initWindow(1280, 720, "BioloidGP Robot - with Dart4.0");
glutMainLoop();
return 0;
}