diff --git a/opendbc b/opendbc index 4925c2a9..190e71e8 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit 4925c2a9993b0587a052856626614a976d8e616b +Subproject commit 190e71e8f0f30bac35c0319c23990cb721f7174e diff --git a/selfdrive/car/ocelot/ocelotcan.py b/selfdrive/car/ocelot/ocelotcan.py index 7d9a89ed..1d289eb2 100644 --- a/selfdrive/car/ocelot/ocelotcan.py +++ b/selfdrive/car/ocelot/ocelotcan.py @@ -1,12 +1,18 @@ -def create_steer_command(packer, steer, mode, raw_cnt): - """Creates a CAN message for the Seb Smith EPAS Steer Command.""" +# def create_steer_command(packer, steer, mode, raw_cnt): +# """Creates a CAN message for the Seb Smith EPAS Steer Command.""" +# values = { +# "STEER_MODE": mode, +# "REQUESTED_STEER_TORQUE": steer, +# "COUNTER": raw_cnt, +# } +# return packer.make_can_msg("OCELOT_STEERING_COMMAND", 2, values) + +def create_steer_command(packer, steer, enabled, raw_cnt): values = { - "STEER_MODE": mode, - "REQUESTED_STEER_TORQUE": steer, - "COUNTER": raw_cnt, + "STEER_TORQUE_CMD": (-steer * 18) if enabled else 0. } - return packer.make_can_msg("OCELOT_STEERING_COMMAND", 2, values) + return packer.make_can_msg("STEER_COMMAND", 2, values) def create_gas_command(packer, gas_amount, idx): # Common gas pedal msg generator @@ -25,7 +31,7 @@ def create_gas_command(packer, gas_amount, idx): def create_brake_cmd(packer, enabled, brake, raw_cnt): values = { - "BRAKE_POSITION_COMMAND" : brake * 47, + "BRAKE_POSITION_COMMAND" : brake * 25, "BRAKE_RELATIVE_COMMAND": 0, "BRAKE_MODE": 2 if enabled else 0, "COUNTER" : raw_cnt,