Reverse switchRecord flag
When rc is down, record mode must be false
This commit is contained in:
parent
2968428443
commit
61dffd0a00
@ -246,7 +246,7 @@ func (a *Part) publishDriveMode() {
|
|||||||
|
|
||||||
func (a *Part) publishSwitchRecord() {
|
func (a *Part) publishSwitchRecord() {
|
||||||
sr := events.SwitchRecordMessage{
|
sr := events.SwitchRecordMessage{
|
||||||
Enabled: a.ctrlRecord,
|
Enabled: !a.ctrlRecord,
|
||||||
}
|
}
|
||||||
switchRecordMessage, err := proto.Marshal(&sr)
|
switchRecordMessage, err := proto.Marshal(&sr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -214,19 +214,19 @@ func TestPublish(t *testing.T) {
|
|||||||
expectedDriveMode events.DriveModeMessage
|
expectedDriveMode events.DriveModeMessage
|
||||||
expectedSwitchRecord events.SwitchRecordMessage
|
expectedSwitchRecord events.SwitchRecordMessage
|
||||||
}{
|
}{
|
||||||
{-1, 1, events.DriveMode_USER, false,
|
{-1, 1, events.DriveMode_USER, true,
|
||||||
events.ThrottleMessage{Throttle: -1., Confidence: 1.},
|
events.ThrottleMessage{Throttle: -1., Confidence: 1.},
|
||||||
events.SteeringMessage{Steering: 1.0, Confidence: 1.},
|
events.SteeringMessage{Steering: 1.0, Confidence: 1.},
|
||||||
events.DriveModeMessage{DriveMode: events.DriveMode_USER},
|
events.DriveModeMessage{DriveMode: events.DriveMode_USER},
|
||||||
events.SwitchRecordMessage{Enabled: false},
|
events.SwitchRecordMessage{Enabled: false},
|
||||||
},
|
},
|
||||||
{0, 0, events.DriveMode_PILOT, true,
|
{0, 0, events.DriveMode_PILOT, false,
|
||||||
events.ThrottleMessage{Throttle: 0., Confidence: 1.},
|
events.ThrottleMessage{Throttle: 0., Confidence: 1.},
|
||||||
events.SteeringMessage{Steering: 0., Confidence: 1.},
|
events.SteeringMessage{Steering: 0., Confidence: 1.},
|
||||||
events.DriveModeMessage{DriveMode: events.DriveMode_PILOT},
|
events.DriveModeMessage{DriveMode: events.DriveMode_PILOT},
|
||||||
events.SwitchRecordMessage{Enabled: true},
|
events.SwitchRecordMessage{Enabled: true},
|
||||||
},
|
},
|
||||||
{0.87, -0.58, events.DriveMode_PILOT, true,
|
{0.87, -0.58, events.DriveMode_PILOT, false,
|
||||||
events.ThrottleMessage{Throttle: 0.87, Confidence: 1.},
|
events.ThrottleMessage{Throttle: 0.87, Confidence: 1.},
|
||||||
events.SteeringMessage{Steering: -0.58, Confidence: 1.},
|
events.SteeringMessage{Steering: -0.58, Confidence: 1.},
|
||||||
events.DriveModeMessage{DriveMode: events.DriveMode_PILOT},
|
events.DriveModeMessage{DriveMode: events.DriveMode_PILOT},
|
||||||
|
Loading…
Reference in New Issue
Block a user