Add CarControl actuators and RadarState leads for longitudinal testing (#39)
parent
b06aa50880
commit
296d95fcf2
|
@ -54,6 +54,47 @@ export const controls = {
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const actuators = {
|
||||||
|
Steer: shortSignal({
|
||||||
|
index: 0,
|
||||||
|
factor: 0.001
|
||||||
|
}),
|
||||||
|
SteerAngle: shortSignal({
|
||||||
|
index: 1,
|
||||||
|
factor: 0.001
|
||||||
|
}),
|
||||||
|
Brake: shortSignal({
|
||||||
|
index: 2,
|
||||||
|
factor: 0.001
|
||||||
|
}),
|
||||||
|
Gas: shortSignal({
|
||||||
|
index: 3,
|
||||||
|
factor: 0.001
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
export const leadOne = {
|
||||||
|
DRel: shortSignal({
|
||||||
|
index: 0,
|
||||||
|
factor: 0.001
|
||||||
|
}),
|
||||||
|
VRel: shortSignal({
|
||||||
|
index: 1,
|
||||||
|
factor: 0.001
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
export const leadTwo = {
|
||||||
|
DRel: shortSignal({
|
||||||
|
index: 0,
|
||||||
|
factor: 0.001
|
||||||
|
}),
|
||||||
|
VRel: shortSignal({
|
||||||
|
index: 1,
|
||||||
|
factor: 0.001
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
export const flags = {
|
export const flags = {
|
||||||
LeftBlinker: boolSignal({
|
LeftBlinker: boolSignal({
|
||||||
index: 0
|
index: 0
|
||||||
|
@ -196,6 +237,9 @@ export const signalMap = {
|
||||||
'CarState:Ego': ego,
|
'CarState:Ego': ego,
|
||||||
'CarState:Controls': controls,
|
'CarState:Controls': controls,
|
||||||
'CarState:Flags': flags,
|
'CarState:Flags': flags,
|
||||||
|
'CarControl:Actuators': actuators,
|
||||||
|
'RadarState:LeadOne': leadOne,
|
||||||
|
'RadarState:LeadTwo': leadTwo,
|
||||||
'UbloxGnss:MeasurementReport': ubloxGnss,
|
'UbloxGnss:MeasurementReport': ubloxGnss,
|
||||||
'Health:Data': health,
|
'Health:Data': health,
|
||||||
'Thermal:CPU': thermalCPU,
|
'Thermal:CPU': thermalCPU,
|
||||||
|
|
|
@ -14,6 +14,9 @@ import {
|
||||||
getEgoData,
|
getEgoData,
|
||||||
getCarStateControls,
|
getCarStateControls,
|
||||||
getWheelSpeeds,
|
getWheelSpeeds,
|
||||||
|
getCarControlActuators,
|
||||||
|
getRadarStateLeadOne,
|
||||||
|
getRadarStateLeadTwo,
|
||||||
getThermalFreeSpace,
|
getThermalFreeSpace,
|
||||||
getThermalData,
|
getThermalData,
|
||||||
getThermalCPU,
|
getThermalCPU,
|
||||||
|
@ -205,6 +208,31 @@ async function loadData(entry) {
|
||||||
monoTime,
|
monoTime,
|
||||||
partial(getWheelSpeeds, msg.CarState)
|
partial(getWheelSpeeds, msg.CarState)
|
||||||
);
|
);
|
||||||
|
} else if ('CarControl' in msg) {
|
||||||
|
const monoTime = msg.LogMonoTime / 1000000000;
|
||||||
|
insertEventData(
|
||||||
|
'CarControl',
|
||||||
|
'Actuators',
|
||||||
|
entry,
|
||||||
|
monoTime,
|
||||||
|
partial(getCarControlActuators, msg.CarControl)
|
||||||
|
);
|
||||||
|
} else if ('RadarState' in msg) {
|
||||||
|
const monoTime = msg.LogMonoTime / 1000000000;
|
||||||
|
insertEventData(
|
||||||
|
'RadarState',
|
||||||
|
'LeadOne',
|
||||||
|
entry,
|
||||||
|
monoTime,
|
||||||
|
partial(getRadarStateLeadOne, msg.RadarState)
|
||||||
|
);
|
||||||
|
insertEventData(
|
||||||
|
'RadarState',
|
||||||
|
'LeadTwo',
|
||||||
|
entry,
|
||||||
|
monoTime,
|
||||||
|
partial(getRadarStateLeadTwo, msg.RadarState)
|
||||||
|
);
|
||||||
} else if ('UbloxGnss' in msg) {
|
} else if ('UbloxGnss' in msg) {
|
||||||
const monoTime = msg.LogMonoTime / 1000000000;
|
const monoTime = msg.LogMonoTime / 1000000000;
|
||||||
if (msg.UbloxGnss.MeasurementReport) {
|
if (msg.UbloxGnss.MeasurementReport) {
|
||||||
|
|
|
@ -168,6 +168,23 @@ export function getWheelSpeeds(state) {
|
||||||
.concat(signedShortToByteArray(state.WheelSpeeds.Rr * 100));
|
.concat(signedShortToByteArray(state.WheelSpeeds.Rr * 100));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getCarControlActuators(state) {
|
||||||
|
return signedShortToByteArray(state.Actuators.Steer * 1000)
|
||||||
|
.concat(signedShortToByteArray(state.Actuators.SteerAngle * 1000))
|
||||||
|
.concat(signedShortToByteArray(state.Actuators.Brake * 1000))
|
||||||
|
.concat(signedShortToByteArray(state.Actuators.Gas * 1000));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRadarStateLeadOne(state) {
|
||||||
|
return signedShortToByteArray(state.LeadOne.DRel * 1000)
|
||||||
|
.concat(signedShortToByteArray(state.LeadOne.VRel * 1000));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRadarStateLeadTwo(state) {
|
||||||
|
return signedShortToByteArray(state.LeadTwo.DRel * 1000)
|
||||||
|
.concat(signedShortToByteArray(state.LeadTwo.VRel * 1000));
|
||||||
|
}
|
||||||
|
|
||||||
export function getThermalFreeSpace(state) {
|
export function getThermalFreeSpace(state) {
|
||||||
return longToByteArray(state.FreeSpace * 1000000000);
|
return longToByteArray(state.FreeSpace * 1000000000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue