当前位置: 首页>>代码示例>>C++>>正文


C++ Pose3D::conc方法代码示例

本文整理汇总了C++中Pose3D::conc方法的典型用法代码示例。如果您正苦于以下问题:C++ Pose3D::conc方法的具体用法?C++ Pose3D::conc怎么用?C++ Pose3D::conc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pose3D的用法示例。


在下文中一共展示了Pose3D::conc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: update

void BallLocator::update(BallModel& ballModel)
{
  DECLARE_DEBUG_DRAWING("module:BallLocator:Field", "drawingOnField");
  DECLARE_DEBUG_DRAWING("module:BallLocator:Image", "drawingOnImage");

#ifdef TARGET_SIM
  if(theFrameInfo.time <= lastFrameTime)
  {
    if(theFrameInfo.time < lastFrameTime)
      init();
    else
      return;
  }
#endif

  // set extra members for seen ball to achieve the following behavior:
  //    if the ball has been seen in the last lower camera image, it will be ignored in
  //    the upper image to exclude any clutter in the robot's environment
  ballWasSeenInThisFrame = theBallPercept.ballWasSeen;
  if(ballWasSeenInThisFrame && theCameraInfo.camera == CameraInfo::upper && ballWasBeenSeenInLastLowerCameraImage)
    ballWasSeenInThisFrame = false;
  else if(theCameraInfo.camera == CameraInfo::lower)
    ballWasBeenSeenInLastLowerCameraImage = ballWasSeenInThisFrame;

  // perform prediction step for each filter
  motionUpdate(ballModel);

  // detect and handle collision with feet
  Pose3D leftFoot = theTorsoMatrix;
  Pose3D rightFoot = theTorsoMatrix;
  leftFoot.conc(theRobotModel.limbs[MassCalibration::footLeft]).translate(footOffset.x, footOffset.y, -theRobotDimensions.heightLeg5Joint);
  rightFoot.conc(theRobotModel.limbs[MassCalibration::footRight]).translate(footOffset.x, -footOffset.y, -theRobotDimensions.heightLeg5Joint);
  Vector2<> leftFootCenter(leftFoot.translation.x, leftFoot.translation.y);
  Vector2<> rightFootCenter(rightFoot.translation.x, rightFoot.translation.y);
  COMPLEX_DRAWING("module:BallLocator:Image",
  {
    Vector2<int> leftCenterImage, leftTopImage, rightCenterImage, rightTopImage;
    if(Geometry::calculatePointInImage(Vector3<>(leftFootCenter.x, leftFootCenter.y, 0), theCameraMatrix, theCameraInfo, leftCenterImage) &&
    Geometry::calculatePointInImage(Vector3<>(leftFootCenter.x + footRadius, leftFootCenter.y, 0), theCameraMatrix, theCameraInfo, leftTopImage))
    {
      CIRCLE("module:BallLocator:Image", leftCenterImage.x, leftCenterImage.y, (leftCenterImage - leftTopImage).abs(), 0, Drawings::ps_solid, ColorRGBA(0, 0, 0), Drawings::bs_null, ColorRGBA());
    }
    if(Geometry::calculatePointInImage(Vector3<>(rightFootCenter.x, rightFootCenter.y, 0), theCameraMatrix, theCameraInfo, rightCenterImage) &&
    Geometry::calculatePointInImage(Vector3<>(rightFootCenter.x + footRadius, rightFootCenter.y, 0), theCameraMatrix, theCameraInfo, rightTopImage))
    {
      CIRCLE("module:BallLocator:Image", rightCenterImage.x, rightCenterImage.y, (rightCenterImage - rightTopImage).abs(), 0, Drawings::ps_solid, ColorRGBA(0, 0, 0), Drawings::bs_null, ColorRGBA());
    }
  });
开发者ID:Ambaboo,项目名称:BHuman2013,代码行数:48,代码来源:BallLocator.cpp


注:本文中的Pose3D::conc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。