Skip to content

Commit

Permalink
add signals
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Dec 22, 2021
1 parent 74014ae commit 2498f7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cereal
Submodule cereal updated 1 files
+2 −0 car.capnp
4 changes: 4 additions & 0 deletions selfdrive/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def update(self, cp, cp_cam):

can_gear = int(cp.vl["GEAR_PACKET"]["GEAR"])
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None))
ret.sportOn = bool(cp.vl["GEAR_PACKET"]["SPORT_ON"])
ret.econOn = bool(cp.vl["GEAR_PACKET"]["ECON_ON"])
ret.leftBlinker = cp.vl["STEERING_LEVERS"]["TURN_SIGNALS"] == 1
ret.rightBlinker = cp.vl["STEERING_LEVERS"]["TURN_SIGNALS"] == 2

Expand Down Expand Up @@ -157,6 +159,8 @@ def get_can_parser(CP):
# sig_name, sig_address, default
("STEER_ANGLE", "STEER_ANGLE_SENSOR", 0),
("GEAR", "GEAR_PACKET", 0),
("SPORT_ON", "GEAR_PACKET", 0),
("ECON_ON", "GEAR_PACKET", 0),
("BRAKE_PRESSED", "BRAKE_MODULE", 0),
("GAS_PEDAL", "GAS_PEDAL", 0),
("WHEEL_SPEED_FL", "WHEEL_SPEEDS", 0),
Expand Down

0 comments on commit 2498f7d

Please sign in to comment.