The SensorData1D class in sensorData.hh needs
improvement. There are at least three problems with it.
1. The isGlobal data member is a boolean. However, the
sensor data being passed from Servo SP to Prim SP is
neither local nor global; it is relative to the
position of the sensor.
2. SensorData1D is designed to be used for several
different purposes, but there is no place where the
documentation of what it means for a specific purpose
belongs. We could use subclasses with no additional
members to provide a place for documentation. If we do
not do that, we should decide where documentation
belongs in cases of this sort.
3. The most severe problem is that since the data being
passed from Servo SP to Prim SP is relative to the
location of the sensor, it is necessary to know the
location of the sensor in order to use the data. The
sensor location is currently being found in Prim SP by
getting the vehicle location from nav data, knowing the
location of the sensor relative to the vehicle, and
computing the position of the sensor. It is assumed
that the vehicle did not move much while the data was
being collected. It is also assumed that the nav data
read in Prim SP is not appreciably different from what
the nav data was in Servo SP at the time the data was
I think we can agree that relative data should be
transmitted only if it is true that the sensor did not
move much while the data was being collected. And I
think that this is true of ladar data being collected
in simpleSim and usarSim and transmitted in a single
message (holler if not).
I do not think the second assumption is tenable.
Communication delays are likely to cause a significant
difference in where the vehicle is between the time the
data is collected and the time nav data is read by
Prim. We are seeing significant scatter in the data
(hit points are showing up on the other side of walls
from the vehicle). A discrepancy in vehicle position is
the likely cause of some or most of the scatter.
All three problems can be solved simultaneously (for
this case) by defining a SensorData1DRelative subclass.
It would have a sensorPosition data member of type
PM_POSE. The isGlobal flag would be taken to refer to
the sensorPosition in this subclass.
Alternatively, the vehiclePosition could be included,
but this seems much inferior, since then information
about where the sensor is on the vehicle needs to be
transmitted from Servo to Prim, and Prim needs to
calculate the sensor position.