本文整理汇总了C++中Pose3D::point方法的典型用法代码示例。如果您正苦于以下问题:C++ Pose3D::point方法的具体用法?C++ Pose3D::point怎么用?C++ Pose3D::point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pose3D
的用法示例。
在下文中一共展示了Pose3D::point方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
void FourWheeler::create(World* in_world, Pose3D in_pose3D)
{
// TODO use full position data
Pose in_pose(in_pose3D.point().x(), in_pose3D.point().y(), Deg(0));
msg::Subs<num::Pose> pose(m_pChannel,"true-pose");
msg::Subs<num::Speed, FourWheeler> reqSpeed(m_pChannel,"speed-requested", this, &FourWheeler::reqSpeed);
msg::Subs<num::Speed> currentSpeed(m_pChannel, "speed-current");
pose.value = in_pose;
m_pSpace = new SimpleSpace(in_world->getSpace());
m_pChassis = new Body(in_world);
m_pChassis->setPosition(in_pose.x().m(),in_pose.y().m(),STARTZ().m());
m_pChassisBox = new BoxGeom(m_pChassis, m_pSpace, ROBOT_LENGTH().m(),ROBOT_WIDTH().m(),ROBOT_HEIGHT().m());
m_pChassisBox->setMass(CHASSIS_MASS());
m_wheels = new Body[4];
for (int i = 0; i < 4; i++)
{
m_wheels[i].create(in_world);
dQuaternion q;
dQFromAxisAndAngle (q,1,0,0,M_PI*0.5);
m_wheels[i].setQuaternion(q);
Geom* geom = new SphereGeom(&m_wheels[i], m_pSpace, RADIUS().m());
geom->setMass(WMASS());
// Magic number (see Pisvejc): make it too big, and turning won't be possible, make it too small, and
// robot will just stay on place, regardless of how fast wheels are turning
geom->m_contactData.mu = 0.75;
}
m_wheels[0].setPosition(in_pose.x().m()+0.4*ROBOT_LENGTH().m(),
in_pose.y().m()+0.5*ROBOT_WIDTH().m(),STARTZ().m()-0.5*ROBOT_HEIGHT().m());
m_wheels[1].setPosition(in_pose.x().m()+0.4*ROBOT_LENGTH().m(),
in_pose.y().m()-0.5*ROBOT_WIDTH().m(),STARTZ().m()-0.5*ROBOT_HEIGHT().m());
m_wheels[2].setPosition(in_pose.x().m()-0.4*ROBOT_LENGTH().m(),
in_pose.y().m()+0.5*ROBOT_WIDTH().m(),STARTZ().m()-0.5*ROBOT_HEIGHT().m());
m_wheels[3].setPosition(in_pose.x().m()-0.4*ROBOT_LENGTH().m(),
in_pose.y().m()-0.5*ROBOT_WIDTH().m(),STARTZ().m()-0.5*ROBOT_HEIGHT().m());
for (int i=0; i<4;i++)
{
m_joints[i] = new Hinge2Joint(in_world);
m_joints[i]->attach(m_pChassis,&m_wheels[i]);
double a[3];
m_wheels[i].getPosition(a);
m_joints[i]->setAnchor (a[0],a[1],a[2]);
m_joints[i]->setAxis1(0,0,(i<2 ? 1 : -1));
m_joints[i]->setAxis2(0,1,0);
m_joints[i]->setParam(dParamSuspensionERP,0.8);
m_joints[i]->setParam(dParamSuspensionCFM,1e-5);
m_joints[i]->setParam(dParamVel2,0);
m_joints[i]->setParam(dParamFMax2,FMAX());
m_joints[i]->setParam(dParamLoStop,0);
m_joints[i]->setParam(dParamHiStop,0);
}
}