2

In a simulation using RPR-FOM, if I get a reflectAttributeValues with a LogicalTime time stamp (simulation time) and the OrderType receive order in my FederateAmbassador. For dead reckoning algorithms do I use the time stamp supplied by the RTI or the time stamp encoded in the userSuppliedTag? Using the userSuppliedTag would be decoded value if absolute and system clock if relative.

To clarify, I get attributes reflected specified receive order from a time managed federate in this call in FederateAmbassador from the RTI:

void reflectAttributeValues(ObjectInstanceHandle theObject,
                               AttributeHandleValueMap theAttributes,
                               byte[] userSuppliedTag,
                               OrderType sentOrdering,
                               TransportationTypeHandle theTransport,
                               LogicalTime theTime,
                               OrderType receivedOrdering,
                               MessageRetractionHandle retractionHandle,
                               SupplementalReflectInfo reflectInfo)
Robert F
  • 451
  • 3
  • 13
  • Did you come up with a resolution for this? – Anthony Cramp Jan 23 '17 at 23:34
  • For attributes that were updated Time Stamp Order, I used the time stamp to know when the attribute last had been updated and simulation time to dead reckon. For attributes that where updated Receive Order without time stamp, I used the user supplied tag to know when the attributed last had been updated (value in the tag for _absolute_ and system clock at the time of receiving the attribute for _relative_) and then using the system clock to dead reckon. – Robert F Jan 24 '17 at 09:03
  • I better make an answer out of this. – Robert F Jan 24 '17 at 09:04

2 Answers2

1

For attributes that were updated Time Stamp Order, I used the time parameter to know when the attribute last had been updated and simulation time to dead reckon.

public void reflectAttributeValues(
            ObjectInstanceHandle objectHandle,
            AttributeHandleValueMap attributes,
            byte[] userSuppliedTag,
            OrderType sentOrdering,
            TransportationTypeHandle theTransport,
            LogicalTime time,
            OrderType receivedOrdering,
            MessageRetractionHandle retractionHandle,
            SupplementalReflectInfo reflectInfo) {
   attributes.forEach((attributeHandle, value) -> {
      lastUpdated.put(attributeHandle, time));
      timeManaged.add(attributeHandle);
      // decode value into your object
      ...
   }
}

For attributes that where updated Receive Order without time stamp, I used the userSuppliedTag to know when the attributed last had been updated (value in the tag for absolute and system clock at the time of receiving the attribute for relative) and then using the system clock to dead reckon.

public void reflectAttributeValues(
            ObjectInstanceHandle objectHandle,
            AttributeHandleValueMap attributes,
            byte[] userSuppliedTag,
            OrderType sentOrdering,
            TransportationTypeHandle theTransport,
            SupplementalReflectInfo reflectInfo) {
    LogicalTime time;
    if (isRelativeTag(userSuppliedTag)) {
       time = factory.createSystemLogicalTime(System.currentTimeMillis());
    } else {
       time = decodeTag(userSuppliedTag);
    }
    attributes.forEach((attributeHandle, value)-> {
       lastUpdated.put(attributeHandle, time);
       timeManaged.remove(attributeHandle); // attributes might switch
       // decode value into your objects
       ...
    }
}

Then to dead reckon:

private Vector3D getDeadReckonedWorldLocation(LogicalTime time) {
   LogicalTime lastUpdatedSpatial = lastUpdated.get(spatialAttributeHandle);
   if (!timeManaged.contains(spatialAttributeHandle)) {
      time = factory.createSystemLogicalTime(System.currentTimeMillis());
   }
   LogicalTimeInterval timeToDeadReckon = time.distance(lastUpdatedSpatial);

   return deadReckon(timeToDeadReckon);
}

Code here are simplified examples and may not compile, but they capture the solution I managed to come up with.

Robert F
  • 451
  • 3
  • 13
0

Most users of the RPR FOM only use the time in the User Supplied Tag.

The HLA Time Management Services are usually not used any you would never receive a LogicalTime or messages in Time Stamp Order (TSO).

See the Federation Agreement for the RPR FOM, "SISO-STD-001-2015: Standard for Guidance, Rationale, and Interoperability Modalities (GRIM) for the Real-time Platform Reference Federation Object Model (RPR FOM)", for more details: https://www.sisostds.org/DigitalLibrary.aspx?Command=Core_Download&EntryId=30822

ante
  • 1,045
  • 10
  • 29
  • Thank you for you reply. I understand that it is unusual to use time management when using the RPR FOM, but it is not prohibited by the GRIM. I am dealing with federates that sometimes need to work with federates that are not real-time which makes using only the User Supplied Tag for dead reckoning impossible. I guess I have to distinguish between updates from time managed and non time managed federates. – Robert F Jan 27 '16 at 08:32
  • Yes, the realtime federates and the time managed federates probably needs to be handled differently, including how dead reckoning should be performed. – ante Jan 27 '16 at 10:16