std_msgs.Header.getFrameId()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中std_msgs.Header.getFrameId()方法的一些代码示例,展示了Header.getFrameId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header.getFrameId()方法的具体详情如下:
包路径:std_msgs.Header
类名称:Header
方法名:getFrameId

Header.getFrameId介绍

暂无

代码示例

代码示例来源:origin: rosjava/rosjava_core

public static FrameTransform fromTransformStampedMessage(
  geometry_msgs.TransformStamped transformStamped) {
 Transform transform = Transform.fromTransformMessage(transformStamped.getTransform());
 String target = transformStamped.getHeader().getFrameId();
 String source = transformStamped.getChildFrameId();
 Time stamp = transformStamped.getHeader().getStamp();
 return new FrameTransform(transform, GraphName.of(source), GraphName.of(target), stamp);
}

代码示例来源:origin: us.ihmc/IHMCROSTools

@Override
public synchronized void onNewMessage(sensor_msgs.Imu message)
{
 this.timeStamp = message.getHeader().getStamp().totalNsecs();
 this.seq_id = message.getHeader().getSeq();
 this.frameId = message.getHeader().getFrameId();
 RosTools.packRosQuaternionToQuat4d(message.getOrientation(), this.orientationEstimate);
 RosTools.packRosVector3ToVector3d(message.getAngularVelocity(), this.angularVelocity);
 RosTools.packRosVector3ToVector3d(message.getLinearAcceleration(), this.linearAcceleration);
 onNewMessage(timeStamp, seq_id, orientationEstimate, angularVelocity, linearAcceleration);
}

代码示例来源:origin: us.ihmc/ihmc-ros-tools

@Override
public synchronized void onNewMessage(sensor_msgs.Imu message)
{
 this.timeStamp = message.getHeader().getStamp().totalNsecs();
 this.seq_id = message.getHeader().getSeq();
 this.frameId = message.getHeader().getFrameId();
 RosTools.packRosQuaternionToEuclidQuaternion(message.getOrientation(), this.orientationEstimate);
 RosTools.packRosVector3ToEuclidTuple3D(message.getAngularVelocity(), this.angularVelocity);
 RosTools.packRosVector3ToEuclidTuple3D(message.getLinearAcceleration(), this.linearAcceleration);
 onNewMessage(timeStamp, seq_id, orientationEstimate, angularVelocity, linearAcceleration);
}

代码示例来源:origin: us.ihmc/IHMCROSTools

@Override
  public synchronized void onNewMessage(PointCloud2 pointCloud)
  {
   growablePointCloud.clear();
   UnpackedPointCloud unpackedCloud=unpackPointsAndIntensities(pointCloud);
   for (int i = 0; i < unpackedCloud.getPoints().length; i++)
   {
     switch (PointType.fromFromFieldNames(pointCloud.getFields()))
     {
      case XYZI :
        if (includePoint(unpackedCloud.getPoints()[i], unpackedCloud.getIntensities()[i]))
         growablePointCloud.addPoint(unpackedCloud.getPoints()[i], unpackedCloud.getIntensities()[i]);
        break;
      case XYZRGB :
        if (includePoint(unpackedCloud.getPoints()[i], unpackedCloud.getPointColors()[i]))
         growablePointCloud.addPoint(unpackedCloud.getPoints()[i], unpackedCloud.getPointColors()[i]);
        break;
     }
   }
   System.out.println("Publishing " + pointCloud.getHeader().getSeq() + " " + growablePointCloud.size() + " points");
   publisher.publish(growablePointCloud.getPoints(), growablePointCloud.getColors(), pointCloud.getHeader().getFrameId());
   /*
    * Transform3d pinkBlobTransform = new Transform3d();
    * pinkBlobTransform.setTranslation(new Vector3d(growablePointCloud.getMeanPoint()));
    * tfPublisher.publish(pinkBlobTransform, pointCloud.getHeader().getStamp().totalNsecs(), "/multisense/left_camera_optical_frame", "pinkBlob");
    */
  }
};

代码示例来源:origin: us.ihmc/ihmc-ros-tools

@Override
  public synchronized void onNewMessage(PointCloud2 pointCloud)
  {
   growablePointCloud.clear();
   UnpackedPointCloud unpackedCloud=unpackPointsAndIntensities(pointCloud);
   for (int i = 0; i < unpackedCloud.getPoints().length; i++)
   {
     switch (PointType.fromFromFieldNames(pointCloud.getFields()))
     {
      case XYZI :
        if (includePoint(unpackedCloud.getPoints()[i], unpackedCloud.getIntensities()[i]))
         growablePointCloud.addPoint(unpackedCloud.getPoints()[i], unpackedCloud.getIntensities()[i]);
        break;
      case XYZRGB :
        if (includePoint(unpackedCloud.getPoints()[i], unpackedCloud.getPointColors()[i]))
         growablePointCloud.addPoint(unpackedCloud.getPoints()[i], unpackedCloud.getPointColors()[i]);
        break;
     }
   }
   System.out.println("Publishing " + pointCloud.getHeader().getSeq() + " " + growablePointCloud.size() + " points");
   publisher.publish(growablePointCloud.getPoints(), growablePointCloud.getColors(), pointCloud.getHeader().getFrameId());
   /*
    * Transform3d pinkBlobTransform = new Transform3d();
    * pinkBlobTransform.setTranslation(new Vector3d(growablePointCloud.getMeanPoint()));
    * tfPublisher.publish(pinkBlobTransform, pointCloud.getHeader().getStamp().totalNsecs(), "/multisense/left_camera_optical_frame", "pinkBlob");
    */
  }
};

代码示例来源:origin: us.ihmc/ihmc-ros-tools

frameID = msg.getHeader().getFrameId();

代码示例来源:origin: us.ihmc/IHMCROSTools

frameID = msg.getHeader().getFrameId();

代码示例来源:origin: us.ihmc/IHMCROSTools

public synchronized void onNewMessage(geometry_msgs.PoseStamped received)
{
 // get timestamp
 timeStamp = received.getHeader().getStamp().totalNsecs();
 
 // get Point
 Double posx = received.getPose().getPosition().getX();
 Double posy = received.getPose().getPosition().getY();
 Double posz = received.getPose().getPosition().getZ();
 
 pos = new Vector3d(posx, posy, posz);
 
 // get Rotation
 Double rotx = received.getPose().getOrientation().getX();
 Double roty = received.getPose().getOrientation().getY();
 Double rotz = received.getPose().getOrientation().getZ();
 Double rotw = received.getPose().getOrientation().getW();
 
 rot = new Quat4d(rotx, roty, rotz, rotw);
 
 // get frameID
 frameID = received.getHeader().getFrameId();
 TimeStampedTransform3D transform = new TimeStampedTransform3D();
 transform.getTransform3D().setTranslation(pos);
 transform.getTransform3D().setRotation(rot);
 transform.setTimeStamp(timeStamp);
 
 newPose(frameID, transform);
}

代码示例来源:origin: us.ihmc/ihmc-ros-tools

public synchronized void onNewMessage(geometry_msgs.PoseStamped received)
{
 // get timestamp
 timeStamp = received.getHeader().getStamp().totalNsecs();
 
 // get Point
 Double posx = received.getPose().getPosition().getX();
 Double posy = received.getPose().getPosition().getY();
 Double posz = received.getPose().getPosition().getZ();
 
 pos = new Vector3D(posx, posy, posz);
 
 // get Rotation
 Double rotx = received.getPose().getOrientation().getX();
 Double roty = received.getPose().getOrientation().getY();
 Double rotz = received.getPose().getOrientation().getZ();
 Double rotw = received.getPose().getOrientation().getW();
 
 rot = new Quaternion(rotx, roty, rotz, rotw);
 
 // get frameID
 frameID = received.getHeader().getFrameId();
 TimeStampedTransform3D transform = new TimeStampedTransform3D();
 transform.getTransform3D().setTranslation(pos);
 transform.getTransform3D().setRotation(rot);
 transform.setTimeStamp(timeStamp);
 
 newPose(frameID, transform);
}

相关文章