本文整理了Java中std_msgs.Header.getSeq()
方法的一些代码示例,展示了Header.getSeq()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header.getSeq()
方法的具体详情如下:
包路径:std_msgs.Header
类名称:Header
方法名:getSeq
暂无
代码示例来源:origin: rosjava/rosjava_core
@Override
public void onNewMessage(rosjava_test_msgs.TestHeader message) {
int seq = message.getHeader().getSeq();
long stamp = message.getHeader().getStamp().totalNsecs();
if (lastMessage != null) {
int lastSeq = lastMessage.getHeader().getSeq();
long lastStamp = lastMessage.getHeader().getStamp().totalNsecs();
assertTrue(String.format("message seq %d <= previous seq %d", seq, lastSeq), seq > lastSeq);
assertTrue(String.format("message stamp %d <= previous stamp %d", stamp, lastStamp),
stamp > lastStamp);
}
lastMessage = message;
latch.countDown();
}
代码示例来源: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/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/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");
*/
}
};
内容来源于网络,如有侵权,请联系作者删除!