From 9ec01c39de9ebd02b030024413be046d4a0cd3b8 Mon Sep 17 00:00:00 2001 From: saji Date: Mon, 4 Mar 2024 20:41:15 -0600 Subject: [PATCH] fix skylab json formatting --- skylab/make_skylab.go | 42 ++++++++++++++++----------------- skylab/skylab_gen.go | 10 ++++---- skylab/templates/golang.go.tmpl | 6 ++--- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/skylab/make_skylab.go b/skylab/make_skylab.go index 97ded63..1b84272 100644 --- a/skylab/make_skylab.go +++ b/skylab/make_skylab.go @@ -18,37 +18,37 @@ import ( // SkylabFile is a yaml file from skylab. type SkylabFile struct { - Packets []PacketDef `yaml:"packets"` - Boards []BoardDef `yaml:"boards"` + Packets []PacketDef `yaml:"packets,omitempty" json:"packets,omitempty"` + Boards []BoardDef `yaml:"boards,omitempty" json:"boards,omitempty"` } type BoardDef struct { - Name string `yaml:"name"` - Transmit []string `yaml:"transmit"` - Receive []string `yaml:"receive"` + Name string `yaml:"name,omitempty" json:"name,omitempty"` + Transmit []string `yaml:"transmit,omitempty" json:"transmit,omitempty"` + Receive []string `yaml:"receive,omitempty" json:"receive,omitempty"` } // data field. type FieldDef struct { - Name string `yaml:"name"` - Type string `yaml:"type"` - Units string `yaml:"units"` - Conversion float32 `yaml:"conversion"` + Name string `yaml:"name,omitempty" json:"name,omitempty"` + Type string `yaml:"type,omitempty" json:"type,omitempty"` + Units string `yaml:"units,omitempty" json:"units,omitempty"` + Conversion float32 `yaml:"conversion,omitempty" json:"conversion,omitempty"` Bits []struct { - Name string `yaml:"name"` - } `yaml:"bits"` + Name string `yaml:"name,omitempty" json:"name,omitempty"` + } `yaml:"bits,omitempty" json:"bits,omitempty"` } // a PacketDef is a full can packet. type PacketDef struct { - Name string `yaml:"name"` - Description string `yaml:"description"` - Id uint32 `yaml:"id"` - Endian string `yaml:"endian"` - Extended bool `yaml:"is_extended"` - Repeat int `yaml:"repeat"` - Offset int `yaml:"offset"` - Data []FieldDef `yaml:"data"` + Name string `yaml:"name,omitempty" json:"name,omitempty"` + Description string `yaml:"description,omitempty" json:"description,omitempty"` + Id uint32 `yaml:"id,omitempty" json:"id,omitempty"` + Endian string `yaml:"endian,omitempty" json:"endian,omitempty"` + IsExtended bool `yaml:"is_extended,omitempty" json:"is_extended,omitempty"` + Repeat int `yaml:"repeat,omitempty" json:"repeat,omitempty"` + Offset int `yaml:"offset,omitempty" json:"offset,omitempty"` + Data []FieldDef `yaml:"data,omitempty" json:"data,omitempty"` } // we need to generate bitfield types. @@ -278,13 +278,13 @@ func idToString(p PacketDef) string { if p.Repeat > 0 { resp := make([]string, p.Repeat) for idx := 0; idx < p.Repeat; idx++ { - resp[idx] = fmt.Sprintf("can.CanID{ Id: 0x%X, Extended: %t }", int(p.Id)+idx*p.Offset, p.Extended) + resp[idx] = fmt.Sprintf("can.CanID{ Id: 0x%X, Extended: %t }", int(p.Id)+idx*p.Offset, p.IsExtended) } return strings.Join(resp, ",") } else { - return fmt.Sprintf("can.CanID{ Id: 0x%X, Extended: %t }", p.Id, p.Extended) + return fmt.Sprintf("can.CanID{ Id: 0x%X, Extended: %t }", p.Id, p.IsExtended) } } diff --git a/skylab/skylab_gen.go b/skylab/skylab_gen.go index a22dd9f..a799973 100644 --- a/skylab/skylab_gen.go +++ b/skylab/skylab_gen.go @@ -1,4 +1,4 @@ -// generated by gen_skylab.go at 2024-02-28 18:38:32.339579498 -0600 CST m=+0.002992359 DO NOT EDIT! +// generated by gen_skylab.go at 2024-03-04 20:39:49.644966621 -0600 CST m=+0.004692195 DO NOT EDIT! package skylab @@ -197,7 +197,7 @@ var idMap = map[can.CanID]bool{ { Id: 0x241, Extended: false }: true, { Id: 0x251, Extended: false }: true, { Id: 0x242, Extended: false }: true, - { Id: 0x18EB2440, Extended: false }: true, + { Id: 0x18EB2440, Extended: true }: true, { Id: 0x600, Extended: false }: true, { Id: 0x601, Extended: false }: true, { Id: 0x602, Extended: false }: true, @@ -449,7 +449,7 @@ func FromCanFrame(f can.Frame) (Packet, error) { var res = &SteeringHorn{} res.UnmarshalPacket(f.Data) return res, nil - case can.CanID{ Id: 0x18EB2440, Extended: false }: + case can.CanID{ Id: 0x18EB2440, Extended: true }: var res = &ThunderstruckStatusMessage{} res.UnmarshalPacket(f.Data) return res, nil @@ -4282,7 +4282,7 @@ type ThunderstruckStatusMessage struct { } func (p *ThunderstruckStatusMessage) CanId() (can.CanID, error) { - c := can.CanID{Extended: false} + c := can.CanID{Extended: true} c.Id = 0x18EB2440 return c, nil } @@ -6377,4 +6377,4 @@ func (p *WslSlipSpeedMeasurement) String() string { // The json representation that was used to generate this data. // can be used to share the parsing data for i.e dynamic python gui. -const SkylabDefinitions = `{"Packets":[{"Name":"bms_measurement","Description":"Voltages for main battery and aux pack","Id":16,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"battery_voltage","Type":"uint16_t","Units":"V","Conversion":0.01,"Bits":null},{"Name":"aux_voltage","Type":"uint16_t","Units":"V","Conversion":0.001,"Bits":null},{"Name":"current","Type":"float","Units":"A","Conversion":1,"Bits":null}]},{"Name":"battery_status","Description":"Status bits for the battery","Id":17,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"battery_state","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"startup"},{"Name":"precharge"},{"Name":"discharging"},{"Name":"lv_only"},{"Name":"charging"},{"Name":"wall_charging"},{"Name":"killed"}]},{"Name":"contactor_state","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"battery_high_contactor"},{"Name":"battery_low_contactor"},{"Name":"battery_vicor_contactor"},{"Name":"battery_pre_contactor"},{"Name":"battery_high2_contactor"},{"Name":"battery_low2_contactor"},{"Name":"charger_high_contactor"},{"Name":"charger_pre_contactor"}]},{"Name":"lv_channel_status","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"aux_fault"},{"Name":"main_fault"},{"Name":"aux_power_valid"},{"Name":"main_power_valid"},{"Name":"aux_power_active"},{"Name":"main_power_active"}]},{"Name":"lv_control_status","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"aux_vicor_enable"},{"Name":"bat_vicor_enable"},{"Name":"aux_relay_held"},{"Name":"aux_ref_enable"},{"Name":"aux_charging_enable"},{"Name":"kill_hv"},{"Name":"kill_lv"},{"Name":"start_button"}]},{"Name":"pack_choice","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"large_pack"},{"Name":"small_pack"}]}]},{"Name":"bms_kill_reason","Description":"Information for when the car kills","Id":18,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reason1","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"OVERVOLT"},{"Name":"UNDERVOLT"},{"Name":"OVERTEMP"},{"Name":"TEMP_DISCONNECT"},{"Name":"COMM_FAIL"}]},{"Name":"reason2","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"HARDWARE"},{"Name":"KILL_PACKET"},{"Name":"UKNOWN"},{"Name":"OVERCURRENT"},{"Name":"PRECHARGE_FAIL"},{"Name":"AUX_OVER_UNDER"},{"Name":"AUX_OVERTEMP"}]},{"Name":"module","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"value","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"bms_module_min_max","Description":"min and max cell voltages and temperatures","Id":19,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"module_max_temp","Type":"int16_t","Units":"C","Conversion":0.01,"Bits":null},{"Name":"module_min_temp","Type":"int16_t","Units":"C","Conversion":0.01,"Bits":null},{"Name":"module_max_voltage","Type":"uint16_t","Units":"V","Conversion":0.001,"Bits":null},{"Name":"module_min_voltage","Type":"uint16_t","Units":"V","Conversion":0.001,"Bits":null}]},{"Name":"bms_soc","Description":"State of charge","Id":20,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"soc","Type":"float","Units":"","Conversion":1,"Bits":null}]},{"Name":"bms_capacity","Description":"State of charge","Id":21,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"Ah","Type":"float","Units":"","Conversion":1,"Bits":null},{"Name":"Wh","Type":"float","Units":"","Conversion":1,"Bits":null}]},{"Name":"bms_currentlimit","Description":"reports BP params for current","Id":24,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"current_max","Type":"int16_t","Units":"A","Conversion":0.01,"Bits":null},{"Name":"current_min","Type":"int16_t","Units":"A","Conversion":0.01,"Bits":null}]},{"Name":"bms_fan_info","Description":"BP Fans","Id":25,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"fan1","Type":"uint16_t","Units":"RPM","Conversion":1,"Bits":null},{"Name":"fan2","Type":"uint16_t","Units":"RPM","Conversion":1,"Bits":null},{"Name":"fan3","Type":"uint16_t","Units":"RPM","Conversion":1,"Bits":null},{"Name":"fan4","Type":"uint16_t","Units":"RPM","Conversion":1,"Bits":null}]},{"Name":"bms_set_min_fan_speed","Description":"packet which sets a minimum fan speed of BMS for a specific time frame in seconds","Id":27,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"fan_percentage","Type":"float","Units":"percent","Conversion":0,"Bits":null},{"Name":"time","Type":"uint16_t","Units":"s","Conversion":0,"Bits":null}]},{"Name":"bms_module","Description":"Voltage and temperature for a single module","Id":64,"Endian":"little","Extended":false,"Repeat":36,"Offset":1,"Data":[{"Name":"voltage","Type":"float","Units":"V","Conversion":1,"Bits":null},{"Name":"temperature","Type":"float","Units":"C","Conversion":1,"Bits":null}]},{"Name":"bms_charger_response","Description":"Response packet from BMS for indicating whether BMS is ready for charging","Id":117,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"response_flags","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"charging_ready"}]}]},{"Name":"chassis_isolation_fault","Description":"chassiss is not isolated from the battery","Id":56,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"fault_detected","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"isolation_fault"}]}]},{"Name":"bms_imd_info","Description":"information from chassis isolation","Id":55,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"d_imc_r_iso","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"d_imc_status_1","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"isolation_fault"},{"Name":"chassis_fault"},{"Name":"system_failure"},{"Name":"calibration_running"},{"Name":"self_test_running"},{"Name":"isolation_warning"},{"Name":"reserved"},{"Name":"reserved_2"}]},{"Name":"d_imc_status_2","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"reserved"},{"Name":"reserved_2"},{"Name":"reserved_3"},{"Name":"reserved_4"},{"Name":"reserved_5"},{"Name":"reserved_6"},{"Name":"reserved_7"},{"Name":"reserved_8"}]},{"Name":"d_vifc_status_1","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"insulation_measurment"},{"Name":"imc_connectivity_not_implemented"},{"Name":"imc_alive_satus_detection"},{"Name":"reserved"},{"Name":"vifc_command_not_implemented"},{"Name":"reserved_2"},{"Name":"reserved_3"},{"Name":"reserved_4"}]},{"Name":"d_vifc_status_2","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"insulation_resistance_value"},{"Name":"reserved"},{"Name":"reserved_2"},{"Name":"reserved_3"},{"Name":"imc_self_test_overAll"},{"Name":"imc_self_test_parameterConfig"},{"Name":"reserved_4"},{"Name":"reserved_5"}]}]},{"Name":"dashboard_pedal_percentages","Description":"ADC values from the brake and accelerator pedals.","Id":656,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"accel_pedal_value","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"brake_pedal_value","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"car_state","Description":"Car gear. Forward, neutral, reverse, etc.","Id":657,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"state","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"dashboard_pedal_fault","Description":"Target speed that the driver should maintain.","Id":658,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"brake_fault_count","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"accel_fault_count","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"dashboard_system_timeout_test","Description":"Exposes whether each system that dashboard is supposed to listen for packets from has sent a packet. Used for testing.","Id":665,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"flag_set_0","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"steering_disconnected"},{"Name":"vision_front_disconnected"},{"Name":"vision_rear_disconnected"},{"Name":"telemetry_disconnected"},{"Name":"wsl_disconnected"},{"Name":"wsr_disconnected"},{"Name":"front_mppt_disconnected"},{"Name":"rear_mppt_disconnected"}]}]},{"Name":"car_speed","Description":"speed of car in meters per second","Id":666,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"speed","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"flight_computer_lv_board_disconnect_counts","Description":"Number of times a board hasn't been heard from within the allowed timeout.","Id":667,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"front_lights","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"rear_lights","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"steering","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"vision","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"driver_display","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"center_console","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"flight_computer_hv_board_disconnect_counts","Description":"Number of times a board hasn't been heard from within the allowed timeout.","Id":668,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"bms","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"charger","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"wsl","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"wsr","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"mppt_front","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"mppt_rear","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"flight_computer_internal_state","Description":"internal bools","Id":669,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"bms","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"battery_kill"},{"Name":"cells_in_charging_threshold"},{"Name":"first_packet_received"}]},{"Name":"charger","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"proximity_detected"}]},{"Name":"photon3","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"enable"}]},{"Name":"wavesculptor","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"sending_reset"},{"Name":"regen_enable"}]},{"Name":"internal","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"accel_pedal_disconnect"},{"Name":"brake_pedal_disconnect"}]}]},{"Name":"power_to_drive","Description":"calculated power required to drive the vehicle","Id":414,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"moving_average_100","Type":"int16_t","Units":"","Conversion":0,"Bits":null},{"Name":"moving_average_1k","Type":"int16_t","Units":"","Conversion":0,"Bits":null},{"Name":"moving_average_10k","Type":"int16_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"array_power","Description":"array power calculated from current and voltage measurements","Id":415,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"front_array_channel_0","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"front_array_channel_1","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"rear_array_channel_0","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"rear_array_channel_1","Type":"uint16_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"array_energy","Description":"cumulative energy received from the array","Id":281,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"energy","Type":"float","Units":"Joule","Conversion":0,"Bits":null}]},{"Name":"array_energy_reset","Description":"resets cumulative energy received from the array","Id":288,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"energy","Type":"float","Units":"Joule","Conversion":0,"Bits":null}]},{"Name":"vision_turn_signals_command","Description":"Command to have the vision board illuminate or turn off left, right, or both turn signals","Id":688,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"lights","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"left_turn_signal"},{"Name":"right_turn_signal"},{"Name":"spare_1"},{"Name":"spare_2"},{"Name":"spare_3"}]}]},{"Name":"vision_brake_lights_command","Description":"Command to have the vision board illuminate or turn off the brake lights","Id":689,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"lights","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"brake_lights"},{"Name":"spare_1"},{"Name":"spare_2"},{"Name":"spare_3"}]}]},{"Name":"vision_headlights_command","Description":"Command to have the vision board illuminate or turn off the headlights and high beams","Id":690,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"lights","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"headlights"},{"Name":"high_beams"},{"Name":"spare_1"},{"Name":"spare_2"},{"Name":"spare_3"}]},{"Name":"brightness","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"vision_horn_command","Description":"Command the vision board honk the horn, must be repeatedly sent otherwise the vision board will stop honking after a bit. See high_power.h for details.","Id":691,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"horn","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"horn"},{"Name":"spare"}]}]},{"Name":"vision_array_latches_command","Description":"Command the vision board to open the array latches","Id":692,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"array_latches","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"array_front"},{"Name":"array_rear"}]}]},{"Name":"vision_rearview_command","Description":"Command the vision board turn on the rear view cameras","Id":693,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"cameras","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"left"},{"Name":"right"},{"Name":"rear"}]}]},{"Name":"tracker_enable","Description":"Enables/disables power trackers. Use 0x610 for the channel transmitting the data packet on 0x600, 0x611 for 0x601, et cetera. Sending 1 in the enable byte turns the tracker on; sending 0 turns it off.","Id":1552,"Endian":"little","Extended":false,"Repeat":6,"Offset":1,"Data":[{"Name":"enable","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"distance_traveled","Description":"distance of wavesculptor odometer","Id":413,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"trip_distance","Type":"float","Units":"m","Conversion":0,"Bits":null}]},{"Name":"charger_state","Description":"Notifies whether the J1772 cable is plugged.","Id":1395,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"state_flags","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"charger_plugged"}]},{"Name":"charger_max_temp","Type":"uint16_t","Units":"C","Conversion":0.001,"Bits":null},{"Name":"fault","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"CHARGER_OVERVOLT"},{"Name":"CHARGER_OVERTEMP"},{"Name":"CHARGER_CAN_TIMEOUT"},{"Name":"BATTERY_HV_KILL"},{"Name":"BATTERY_UNDERVOLT"},{"Name":"BATTERY_OVERVOLT"},{"Name":"BATTERY_CELL_OVERTEMP"},{"Name":"BATTERY_CAN_TIMEOUT"}]},{"Name":"charging_current","Type":"float","Units":"A","Conversion":0,"Bits":null}]},{"Name":"charger_bms_request","Description":"Request packet for sending contactor commands from the charger to BP.","Id":116,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"request_flags","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"charging_requested"}]}]},{"Name":"charger_current_voltage","Description":"Packet to request charging current/voltage set","Id":1398,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"max_current","Type":"float","Units":"A","Conversion":0,"Bits":null},{"Name":"max_capacity","Type":"float","Units":"kWh","Conversion":0,"Bits":null}]},{"Name":"charger_power","Description":"Outputs the amount of power that the chargers are delivering.","Id":1399,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"power","Type":"float","Units":"W","Conversion":0,"Bits":null}]},{"Name":"thunderstruck_control_message","Description":"Control packet for thunderstruck chargers","Id":417677348,"Endian":"little","Extended":true,"Repeat":0,"Offset":0,"Data":[{"Name":"Enable","Type":"uint8_t","Units":"V","Conversion":1,"Bits":null},{"Name":"CHARGE_VOLTAGE","Type":"uint16_t","Units":"V","Conversion":1,"Bits":null},{"Name":"CHARGE_CURRENT","Type":"uint16_t","Units":"V","Conversion":1,"Bits":null},{"Name":"LED_BLINK_PATTERN","Type":"uint8_t","Units":"V","Conversion":1,"Bits":null},{"Name":"RESERVED","Type":"uint16_t","Units":"V","Conversion":1,"Bits":null}]},{"Name":"vision_status_front","Description":"Status of the front vision board outputs","Id":694,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"lights","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"left_turn_signal"},{"Name":"right_turn_signal"},{"Name":"brake_lights"},{"Name":"headlights"},{"Name":"high_beams"},{"Name":"spare_1"},{"Name":"spare_2"},{"Name":"spare_3"}]},{"Name":"horn","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"horn"},{"Name":"spare"}]},{"Name":"cameras","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"left"},{"Name":"right"},{"Name":"rear"}]},{"Name":"array_latches","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"array_front_0"},{"Name":"array_front_1"},{"Name":"array_rear_0"},{"Name":"array_rear_1"}]}]},{"Name":"vision_status_rear","Description":"Status of the rear vision board outputs","Id":695,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"lights","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"left_turn_signal"},{"Name":"right_turn_signal"},{"Name":"brake_lights"},{"Name":"headlights"},{"Name":"high_beams"},{"Name":"spare_1"},{"Name":"spare_2"},{"Name":"spare_3"}]},{"Name":"horn","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"horn"},{"Name":"spare"}]},{"Name":"cameras","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"left"},{"Name":"right"},{"Name":"rear"}]},{"Name":"array_latches","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"array_front_0"},{"Name":"array_front_1"},{"Name":"array_rear_0"},{"Name":"array_rear_1"}]}]},{"Name":"lights_front_id","Description":"Unique identification packet for front lights board","Id":768,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"board_id","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"mcu_temp","Type":"int16_t","Units":"C","Conversion":0.01,"Bits":null},{"Name":"bus_voltage","Type":"uint16_t","Units":"V","Conversion":0.001,"Bits":null},{"Name":"fault_code","Type":"uint16_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"lights_back_id","Description":"Unique identification packet for back lights board","Id":769,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"board_id","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"mcu_temp","Type":"int16_t","Units":"C","Conversion":0.01,"Bits":null},{"Name":"bus_voltage","Type":"uint16_t","Units":"V","Conversion":0.001,"Bits":null},{"Name":"fault_code","Type":"uint16_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"vision_id","Description":"Unique identification packet for vision","Id":770,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"board_id","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"mcu_temp","Type":"int16_t","Units":"C","Conversion":0.01,"Bits":null},{"Name":"bus_voltage","Type":"uint16_t","Units":"V","Conversion":0.001,"Bits":null},{"Name":"fault_code","Type":"uint16_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"steering_press_count_1","Description":"Shows whether each button has been toggled an even (\"on\") or odd (\"off\") number of times.","Id":576,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"button0","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button1","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button2","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button3","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button4","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button5","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button6","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"steering_press_count_2","Description":"Shows whether each button has been toggled an even (\"on\") or odd (\"off\") number of times.","Id":592,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"button7","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button8","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button9","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button10","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"steering_button_colors_1","Description":"This packet controls each button's color. Each byte is a hex color code.","Id":577,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"button0","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button1","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button2","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button3","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button4","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button5","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button6","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"steering_button_colors_2","Description":"This packet controls each button's color. Each byte is a hex color code.","Id":593,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"button7","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button8","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button9","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"button10","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"steering_horn","Description":"This packet controls the state of the horn.","Id":578,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"horn","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"thunderstruck_status_message","Description":"Status packet for thunderstruck chargers","Id":418063424,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"STATUS_FLAGS","Type":"uint8_t","Units":"V","Conversion":1,"Bits":null},{"Name":"CHARGE_FLAGS","Type":"uint8_t","Units":"V","Conversion":1,"Bits":null},{"Name":"OUTPUT_VOLTAGE","Type":"uint16_t","Units":"V","Conversion":1,"Bits":null},{"Name":"OUTPUT_CURRENT","Type":"uint16_t","Units":"V","Conversion":1,"Bits":null},{"Name":"CHARGER_TEMP","Type":"uint8_t","Units":"V","Conversion":1,"Bits":null},{"Name":"RESERVED","Type":"uint8_t","Units":"V","Conversion":1,"Bits":null}]},{"Name":"tracker_data","Description":"Tracker data. Each channel transmits on a specific ID, which should be specified along with the tracker, most likely 0x600-0x603.","Id":1536,"Endian":"little","Extended":false,"Repeat":6,"Offset":1,"Data":[{"Name":"array_voltage","Type":"uint16_t","Units":"V","Conversion":0.01,"Bits":null},{"Name":"array_current","Type":"uint16_t","Units":"A","Conversion":0.001,"Bits":null},{"Name":"battery_voltage","Type":"uint16_t","Units":"V","Conversion":0.01,"Bits":null},{"Name":"temperature","Type":"uint16_t","Units":"C","Conversion":0.01,"Bits":null}]},{"Name":"tritium_motor_drive_l","Description":"Tritium Motor Drive Command","Id":289,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"motor_velocity","Type":"float","Units":"","Conversion":0,"Bits":null},{"Name":"motor_current","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"tritium_motor_power_l","Description":"Tritium Motor Power Command","Id":290,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reserved","Type":"float","Units":"","Conversion":0,"Bits":null},{"Name":"bus_current","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"tritium_reset_l","Description":"Tritium Reset Command","Id":291,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"unused1","Type":"float","Units":"","Conversion":0,"Bits":null},{"Name":"unused2","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"tritium_motor_drive_r","Description":"Tritium Motor Drive Command","Id":353,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"motor_velocity","Type":"float","Units":"","Conversion":0,"Bits":null},{"Name":"motor_current","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"tritium_motor_power_r","Description":"Tritium Motor Power Command","Id":354,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reserved","Type":"float","Units":"","Conversion":0,"Bits":null},{"Name":"bus_current","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"tritium_reset_r","Description":"Tritium Reset Command","Id":355,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"unused1","Type":"float","Units":"","Conversion":0,"Bits":null},{"Name":"unused2","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"bms_ah_set","Description":"write state of charge, use with caution","Id":22,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"ah","Type":"uint32_t","Units":"","Conversion":0.00001,"Bits":null}]},{"Name":"bms_wh_set","Description":"write state of charge, use with caution","Id":23,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"wh","Type":"uint32_t","Units":"","Conversion":0.00001,"Bits":null}]},{"Name":"bms_kill","Description":"packet to cause BMS kill","Id":26,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"kill_type","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"KILL_HARD"}]}]},{"Name":"telemetry_rtc_reset","Description":"Reset telemetry's real-time clock (RTC).","Id":1792,"Endian":"","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"year","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"month","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"day","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"hour","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"minute","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"second","Type":"uint8_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"wsr_identification","Description":"WS RIGHT Identification Information","Id":320,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"tritium_id","Type":"uint32_t","Units":"","Conversion":0,"Bits":null},{"Name":"serial_number","Type":"uint32_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"wsr_status_information","Description":"WS RIGHT Status Information","Id":321,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"limit_flags","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"output_voltage_pwm"},{"Name":"motor_current"},{"Name":"velocity"},{"Name":"bus_current"},{"Name":"bus_voltage_upper_limit"},{"Name":"bus_voltage_lower_limit"},{"Name":"ipm_temperature_or_motor_temperature"},{"Name":"reserved"}]},{"Name":"limit_flags_reserved","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"error_flags_0","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"hardware_over_current"},{"Name":"software_over_current"},{"Name":"dc_bus_over_voltage"},{"Name":"bad_motor_position_hall_sequence"},{"Name":"watchdog_caused_last_reset"},{"Name":"config_read_error"},{"Name":"lv_rail_under_voltage_lock_out"},{"Name":"desaturation_fault"}]},{"Name":"error_flags_1","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"motor_over_speed"},{"Name":"reserved_9"},{"Name":"reserved_10"},{"Name":"reserved_11"},{"Name":"reserved_12"},{"Name":"reserved_13"},{"Name":"reserved_14"},{"Name":"reserved_15"}]},{"Name":"active_motor","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"reserved","Type":"uint16_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"wsr_bus_measurement","Description":"WS RIGHT Bus Measurement","Id":322,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"bus_voltage","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"bus_current","Type":"float","Units":"A","Conversion":0,"Bits":null}]},{"Name":"wsr_velocity","Description":"WS RIGHT Velocity Measurement","Id":323,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"motor_velocity","Type":"float","Units":"rpm","Conversion":0,"Bits":null},{"Name":"vehicle_velocity","Type":"float","Units":"m/s","Conversion":0,"Bits":null}]},{"Name":"wsr_phase_current","Description":"WS RIGHT Phase Current Measurement","Id":324,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"phase_b_current","Type":"float","Units":"A rms","Conversion":0,"Bits":null},{"Name":"phase_c_current","Type":"float","Units":"A rms","Conversion":0,"Bits":null}]},{"Name":"wsr_motor_voltage_vector","Description":"WS RIGHT Motor Voltage Vector Measurement","Id":325,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"vq","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"vd","Type":"float","Units":"V","Conversion":0,"Bits":null}]},{"Name":"wsr_motor_current_vector","Description":"WS RIGHT Motor Current Vector Measurement","Id":326,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"iq","Type":"float","Units":"A","Conversion":0,"Bits":null},{"Name":"id","Type":"float","Units":"A","Conversion":0,"Bits":null}]},{"Name":"wsr_motor_backemf","Description":"WS RIGHT Motor BackEMF Measurement / Prediction","Id":327,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"bemfq","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"bemfd","Type":"float","Units":"V","Conversion":0,"Bits":null}]},{"Name":"wsr_15_165_voltage_rail","Description":"WS RIGHT 15 and 1.65 Voltage Rail Measurement","Id":328,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reference_165v","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"supply_15v","Type":"float","Units":"V","Conversion":0,"Bits":null}]},{"Name":"wsr_25_12_voltage_rail","Description":"WS RIGHT 2.5V and 1.2V Voltage Rail Measurement","Id":329,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"supply_12v","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"supply_25v","Type":"float","Units":"V","Conversion":0,"Bits":null}]},{"Name":"wsr_heatsink_motor_temp","Description":"WS RIGHT Heat-sink \u0026 Motor Temperature Measurement","Id":331,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"motor_temp","Type":"float","Units":"C","Conversion":0,"Bits":null},{"Name":"heatsink_temp","Type":"float","Units":"C","Conversion":0,"Bits":null}]},{"Name":"wsr_dsp_board_temp","Description":"WS RIGHT DPS Board Temperature Measurement","Id":332,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"dsp_board_temp","Type":"float","Units":"C","Conversion":0,"Bits":null},{"Name":"reserved","Type":"float","Units":"C","Conversion":0,"Bits":null}]},{"Name":"wsr_reserved","Description":"WS RIGHT Reserved","Id":333,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reserved0","Type":"float","Units":"","Conversion":0,"Bits":null},{"Name":"reserved1","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"wsr_odometer_bus_amphours_measurement","Description":"WS RIGHT Odometer and Bus AmpHours Measurement","Id":334,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"odometer","Type":"float","Units":"m","Conversion":0,"Bits":null},{"Name":"dc_bus_amphours","Type":"float","Units":"Ah","Conversion":0,"Bits":null}]},{"Name":"wsr_slip_speed_measurement","Description":"WS RIGHT Slip Speed Measurement","Id":343,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reserved","Type":"float","Units":"C","Conversion":0,"Bits":null},{"Name":"slip_speed","Type":"float","Units":"Hz","Conversion":0,"Bits":null}]},{"Name":"wsl_identification","Description":"WS LEFT Identification Information","Id":256,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"tritium_id","Type":"uint32_t","Units":"","Conversion":0,"Bits":null},{"Name":"serial_number","Type":"uint32_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"wsl_status_information","Description":"WS LEFT Status Information","Id":257,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"limit_flags","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"output_voltage_pwm"},{"Name":"motor_current"},{"Name":"velocity"},{"Name":"bus_current"},{"Name":"bus_voltage_upper_limit"},{"Name":"bus_voltage_lower_limit"},{"Name":"ipm_temperature_or_motor_temperature"},{"Name":"reserved"}]},{"Name":"limit_flags_reserved","Type":"uint8_t","Units":"","Conversion":0,"Bits":null},{"Name":"error_flags_0","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"hardware_over_current"},{"Name":"software_over_current"},{"Name":"dc_bus_over_voltage"},{"Name":"bad_motor_position_hall_sequence"},{"Name":"watchdog_caused_last_reset"},{"Name":"config_read_error"},{"Name":"lv_rail_under_voltage_lock_out"},{"Name":"desaturation_fault"}]},{"Name":"error_flags_1","Type":"bitfield","Units":"","Conversion":0,"Bits":[{"Name":"motor_over_speed"},{"Name":"reserved_9"},{"Name":"reserved_10"},{"Name":"reserved_11"},{"Name":"reserved_12"},{"Name":"reserved_13"},{"Name":"reserved_14"},{"Name":"reserved_15"}]},{"Name":"active_motor","Type":"uint16_t","Units":"","Conversion":0,"Bits":null},{"Name":"reserved","Type":"uint16_t","Units":"","Conversion":0,"Bits":null}]},{"Name":"wsl_bus_measurement","Description":"WS LEFT Bus Measurement","Id":258,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"bus_voltage","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"bus_current","Type":"float","Units":"A","Conversion":0,"Bits":null}]},{"Name":"wsl_velocity","Description":"WS LEFT Velocity Measurement","Id":259,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"motor_velocity","Type":"float","Units":"rpm","Conversion":0,"Bits":null},{"Name":"vehicle_velocity","Type":"float","Units":"m/s","Conversion":0,"Bits":null}]},{"Name":"wsl_phase_current","Description":"WS LEFT Phase Current Measurement","Id":260,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"phase_b_current","Type":"float","Units":"A rms","Conversion":0,"Bits":null},{"Name":"phase_c_current","Type":"float","Units":"A rms","Conversion":0,"Bits":null}]},{"Name":"wsl_motor_voltage_vector","Description":"WS LEFT Motor Voltage Vector Measurement","Id":261,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"vq","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"vd","Type":"float","Units":"V","Conversion":0,"Bits":null}]},{"Name":"wsl_motor_current_vector","Description":"WS LEFT Motor Current Vector Measurement","Id":262,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"iq","Type":"float","Units":"A","Conversion":0,"Bits":null},{"Name":"id","Type":"float","Units":"A","Conversion":0,"Bits":null}]},{"Name":"wsl_motor_backemf","Description":"WS LEFT Motor BackEMF Measurement / Prediction","Id":263,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"bemfq","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"bemfd","Type":"float","Units":"V","Conversion":0,"Bits":null}]},{"Name":"wsl_15_165_voltage_rail","Description":"WS LEFT 15 and 1.65 Voltage Rail Measurement","Id":264,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reference_165v","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"supply_15v","Type":"float","Units":"V","Conversion":0,"Bits":null}]},{"Name":"wsl_25_12_voltage_rail","Description":"WS LEFT 2.5V and 1.2V Voltage Rail Measurement","Id":265,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"supply_12v","Type":"float","Units":"V","Conversion":0,"Bits":null},{"Name":"supply_25v","Type":"float","Units":"V","Conversion":0,"Bits":null}]},{"Name":"wsl_heatsink_motor_temp","Description":"WS LEFT Heat-sink \u0026 Motor Temperature Measurement","Id":267,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"motor_temp","Type":"float","Units":"C","Conversion":0,"Bits":null},{"Name":"heatsink_temp","Type":"float","Units":"C","Conversion":0,"Bits":null}]},{"Name":"wsl_dsp_board_temp","Description":"WS LEFT DPS Board Temperature Measurement","Id":268,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"dsp_board_temp","Type":"float","Units":"C","Conversion":0,"Bits":null},{"Name":"reserved","Type":"float","Units":"C","Conversion":0,"Bits":null}]},{"Name":"wsl_odometer_bus_amphours_measurement","Description":"WS LEFT Odometer and Bus AmpHours Measurement","Id":270,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"odometer","Type":"float","Units":"m","Conversion":0,"Bits":null},{"Name":"dc_bus_amphours","Type":"float","Units":"Ah","Conversion":0,"Bits":null}]},{"Name":"wsl_reserved","Description":"WS LEFT Reserved","Id":269,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reserved0","Type":"float","Units":"","Conversion":0,"Bits":null},{"Name":"reserved1","Type":"float","Units":"","Conversion":0,"Bits":null}]},{"Name":"wsl_slip_speed_measurement","Description":"WS LEFT Slip Speed Measurement","Id":279,"Endian":"little","Extended":false,"Repeat":0,"Offset":0,"Data":[{"Name":"reserved","Type":"float","Units":"C","Conversion":0,"Bits":null},{"Name":"slip_speed","Type":"float","Units":"Hz","Conversion":0,"Bits":null}]}],"Boards":[{"Name":"bms","Transmit":["bms_measurement","bms_capacity","bms_charger_response","battery_status","bms_kill_reason","bms_module_min_max","bms_soc","bms_currentlimit","bms_fan_info","bms_module"],"Receive":["bms_kill","bms_wh_set","bms_ah_set","bms_set_min_fan_speed","charger_bms_request","chassis_isolation_fault"]},{"Name":"bridge_board","Transmit":["chassis_isolation_fault"],"Receive":["bms_imd_info","battery_status"]},{"Name":"charger","Transmit":["charger_state","charger_bms_request","charger_power","thunderstruck_control_message"],"Receive":["bms_charger_response","battery_status","bms_module_min_max","bms_measurement","charger_current_voltage","bms_capacity","thunderstruck_status_message"]},{"Name":"flight_computer","Transmit":["tracker_enable","vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","vision_horn_command","tritium_motor_drive_l","tritium_motor_drive_r","steering_button_colors_1","steering_button_colors_2","tritium_reset_l","tritium_reset_r","dashboard_pedal_percentages","car_state","car_speed","dashboard_pedal_fault","flight_computer_hv_board_disconnect_counts","flight_computer_lv_board_disconnect_counts","flight_computer_internal_state","power_to_drive","array_power","array_energy","distance_traveled"],"Receive":["bms_module_min_max","charger_state","steering_press_count_1","steering_press_count_2","wsl_velocity","wsr_velocity","steering_horn","bms_kill_reason","bms_measurement","tracker_data","vision_status_front","vision_status_rear","wsl_odometer_bus_amphours_measurement","array_energy_reset","wsr_odometer_bus_amphours_measurement"]},{"Name":"g4_example","Transmit":["vision_status_front","vision_headlights_command","demo_packet"],"Receive":["vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","vision_horn_command","demo_packet"]},{"Name":"lights","Transmit":["vision_status_front","vision_status_rear","lights_front_id","lights_back_id"],"Receive":["vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","bms_kill_reason"]},{"Name":"skylab2_demo","Transmit":["vision_status_front","vision_headlights_command"],"Receive":["vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","vision_horn_command"]},{"Name":"steering","Transmit":["steering_press_count_1","steering_press_count_2","steering_horn"],"Receive":["steering_button_colors_1","steering_button_colors_2"]},{"Name":"vision","Transmit":["vision_status_front","vision_id"],"Receive":["vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","vision_horn_command","vision_array_latches_command","vision_rearview_command"]}]}` +const SkylabDefinitions = `{"packets":[{"name":"bms_measurement","description":"Voltages for main battery and aux pack","id":16,"endian":"little","data":[{"name":"battery_voltage","type":"uint16_t","units":"V","conversion":0.01},{"name":"aux_voltage","type":"uint16_t","units":"V","conversion":0.001},{"name":"current","type":"float","units":"A","conversion":1}]},{"name":"battery_status","description":"Status bits for the battery","id":17,"endian":"little","data":[{"name":"battery_state","type":"bitfield","bits":[{"name":"startup"},{"name":"precharge"},{"name":"discharging"},{"name":"lv_only"},{"name":"charging"},{"name":"wall_charging"},{"name":"killed"}]},{"name":"contactor_state","type":"bitfield","bits":[{"name":"battery_high_contactor"},{"name":"battery_low_contactor"},{"name":"battery_vicor_contactor"},{"name":"battery_pre_contactor"},{"name":"battery_high2_contactor"},{"name":"battery_low2_contactor"},{"name":"charger_high_contactor"},{"name":"charger_pre_contactor"}]},{"name":"lv_channel_status","type":"bitfield","bits":[{"name":"aux_fault"},{"name":"main_fault"},{"name":"aux_power_valid"},{"name":"main_power_valid"},{"name":"aux_power_active"},{"name":"main_power_active"}]},{"name":"lv_control_status","type":"bitfield","bits":[{"name":"aux_vicor_enable"},{"name":"bat_vicor_enable"},{"name":"aux_relay_held"},{"name":"aux_ref_enable"},{"name":"aux_charging_enable"},{"name":"kill_hv"},{"name":"kill_lv"},{"name":"start_button"}]},{"name":"pack_choice","type":"bitfield","bits":[{"name":"large_pack"},{"name":"small_pack"}]}]},{"name":"bms_kill_reason","description":"Information for when the car kills","id":18,"endian":"little","data":[{"name":"reason1","type":"bitfield","bits":[{"name":"OVERVOLT"},{"name":"UNDERVOLT"},{"name":"OVERTEMP"},{"name":"TEMP_DISCONNECT"},{"name":"COMM_FAIL"}]},{"name":"reason2","type":"bitfield","bits":[{"name":"HARDWARE"},{"name":"KILL_PACKET"},{"name":"UKNOWN"},{"name":"OVERCURRENT"},{"name":"PRECHARGE_FAIL"},{"name":"AUX_OVER_UNDER"},{"name":"AUX_OVERTEMP"}]},{"name":"module","type":"uint16_t"},{"name":"value","type":"float"}]},{"name":"bms_module_min_max","description":"min and max cell voltages and temperatures","id":19,"endian":"little","data":[{"name":"module_max_temp","type":"int16_t","units":"C","conversion":0.01},{"name":"module_min_temp","type":"int16_t","units":"C","conversion":0.01},{"name":"module_max_voltage","type":"uint16_t","units":"V","conversion":0.001},{"name":"module_min_voltage","type":"uint16_t","units":"V","conversion":0.001}]},{"name":"bms_soc","description":"State of charge","id":20,"endian":"little","data":[{"name":"soc","type":"float","conversion":1}]},{"name":"bms_capacity","description":"State of charge","id":21,"endian":"little","data":[{"name":"Ah","type":"float","conversion":1},{"name":"Wh","type":"float","conversion":1}]},{"name":"bms_currentlimit","description":"reports BP params for current","id":24,"endian":"little","data":[{"name":"current_max","type":"int16_t","units":"A","conversion":0.01},{"name":"current_min","type":"int16_t","units":"A","conversion":0.01}]},{"name":"bms_fan_info","description":"BP Fans","id":25,"endian":"little","data":[{"name":"fan1","type":"uint16_t","units":"RPM","conversion":1},{"name":"fan2","type":"uint16_t","units":"RPM","conversion":1},{"name":"fan3","type":"uint16_t","units":"RPM","conversion":1},{"name":"fan4","type":"uint16_t","units":"RPM","conversion":1}]},{"name":"bms_set_min_fan_speed","description":"packet which sets a minimum fan speed of BMS for a specific time frame in seconds","id":27,"endian":"little","data":[{"name":"fan_percentage","type":"float","units":"percent"},{"name":"time","type":"uint16_t","units":"s"}]},{"name":"bms_module","description":"Voltage and temperature for a single module","id":64,"endian":"little","repeat":36,"offset":1,"data":[{"name":"voltage","type":"float","units":"V","conversion":1},{"name":"temperature","type":"float","units":"C","conversion":1}]},{"name":"bms_charger_response","description":"Response packet from BMS for indicating whether BMS is ready for charging","id":117,"endian":"little","data":[{"name":"response_flags","type":"bitfield","bits":[{"name":"charging_ready"}]}]},{"name":"chassis_isolation_fault","description":"chassiss is not isolated from the battery","id":56,"data":[{"name":"fault_detected","type":"bitfield","bits":[{"name":"isolation_fault"}]}]},{"name":"bms_imd_info","description":"information from chassis isolation","id":55,"data":[{"name":"d_imc_r_iso","type":"uint16_t"},{"name":"d_imc_status_1","type":"bitfield","bits":[{"name":"isolation_fault"},{"name":"chassis_fault"},{"name":"system_failure"},{"name":"calibration_running"},{"name":"self_test_running"},{"name":"isolation_warning"},{"name":"reserved"},{"name":"reserved_2"}]},{"name":"d_imc_status_2","type":"bitfield","bits":[{"name":"reserved"},{"name":"reserved_2"},{"name":"reserved_3"},{"name":"reserved_4"},{"name":"reserved_5"},{"name":"reserved_6"},{"name":"reserved_7"},{"name":"reserved_8"}]},{"name":"d_vifc_status_1","type":"bitfield","bits":[{"name":"insulation_measurment"},{"name":"imc_connectivity_not_implemented"},{"name":"imc_alive_satus_detection"},{"name":"reserved"},{"name":"vifc_command_not_implemented"},{"name":"reserved_2"},{"name":"reserved_3"},{"name":"reserved_4"}]},{"name":"d_vifc_status_2","type":"bitfield","bits":[{"name":"insulation_resistance_value"},{"name":"reserved"},{"name":"reserved_2"},{"name":"reserved_3"},{"name":"imc_self_test_overAll"},{"name":"imc_self_test_parameterConfig"},{"name":"reserved_4"},{"name":"reserved_5"}]}]},{"name":"dashboard_pedal_percentages","description":"ADC values from the brake and accelerator pedals.","id":656,"endian":"little","data":[{"name":"accel_pedal_value","type":"uint8_t"},{"name":"brake_pedal_value","type":"uint8_t"}]},{"name":"car_state","description":"Car gear. Forward, neutral, reverse, etc.","id":657,"endian":"little","data":[{"name":"state","type":"uint8_t"}]},{"name":"dashboard_pedal_fault","description":"Target speed that the driver should maintain.","id":658,"endian":"little","data":[{"name":"brake_fault_count","type":"uint8_t"},{"name":"accel_fault_count","type":"uint8_t"}]},{"name":"dashboard_system_timeout_test","description":"Exposes whether each system that dashboard is supposed to listen for packets from has sent a packet. Used for testing.","id":665,"endian":"little","data":[{"name":"flag_set_0","type":"bitfield","bits":[{"name":"steering_disconnected"},{"name":"vision_front_disconnected"},{"name":"vision_rear_disconnected"},{"name":"telemetry_disconnected"},{"name":"wsl_disconnected"},{"name":"wsr_disconnected"},{"name":"front_mppt_disconnected"},{"name":"rear_mppt_disconnected"}]}]},{"name":"car_speed","description":"speed of car in meters per second","id":666,"endian":"little","data":[{"name":"speed","type":"float"}]},{"name":"flight_computer_lv_board_disconnect_counts","description":"Number of times a board hasn't been heard from within the allowed timeout.","id":667,"endian":"little","data":[{"name":"front_lights","type":"uint8_t"},{"name":"rear_lights","type":"uint8_t"},{"name":"steering","type":"uint8_t"},{"name":"vision","type":"uint8_t"},{"name":"driver_display","type":"uint8_t"},{"name":"center_console","type":"uint8_t"}]},{"name":"flight_computer_hv_board_disconnect_counts","description":"Number of times a board hasn't been heard from within the allowed timeout.","id":668,"endian":"little","data":[{"name":"bms","type":"uint8_t"},{"name":"charger","type":"uint8_t"},{"name":"wsl","type":"uint8_t"},{"name":"wsr","type":"uint8_t"},{"name":"mppt_front","type":"uint8_t"},{"name":"mppt_rear","type":"uint8_t"}]},{"name":"flight_computer_internal_state","description":"internal bools","id":669,"endian":"little","data":[{"name":"bms","type":"bitfield","bits":[{"name":"battery_kill"},{"name":"cells_in_charging_threshold"},{"name":"first_packet_received"}]},{"name":"charger","type":"bitfield","bits":[{"name":"proximity_detected"}]},{"name":"photon3","type":"bitfield","bits":[{"name":"enable"}]},{"name":"wavesculptor","type":"bitfield","bits":[{"name":"sending_reset"},{"name":"regen_enable"}]},{"name":"internal","type":"bitfield","bits":[{"name":"accel_pedal_disconnect"},{"name":"brake_pedal_disconnect"}]}]},{"name":"power_to_drive","description":"calculated power required to drive the vehicle","id":414,"endian":"little","data":[{"name":"moving_average_100","type":"int16_t"},{"name":"moving_average_1k","type":"int16_t"},{"name":"moving_average_10k","type":"int16_t"}]},{"name":"array_power","description":"array power calculated from current and voltage measurements","id":415,"endian":"little","data":[{"name":"front_array_channel_0","type":"uint16_t"},{"name":"front_array_channel_1","type":"uint16_t"},{"name":"rear_array_channel_0","type":"uint16_t"},{"name":"rear_array_channel_1","type":"uint16_t"}]},{"name":"array_energy","description":"cumulative energy received from the array","id":281,"endian":"little","data":[{"name":"energy","type":"float","units":"Joule"}]},{"name":"array_energy_reset","description":"resets cumulative energy received from the array","id":288,"endian":"little","data":[{"name":"energy","type":"float","units":"Joule"}]},{"name":"vision_turn_signals_command","description":"Command to have the vision board illuminate or turn off left, right, or both turn signals","id":688,"data":[{"name":"lights","type":"bitfield","bits":[{"name":"left_turn_signal"},{"name":"right_turn_signal"},{"name":"spare_1"},{"name":"spare_2"},{"name":"spare_3"}]}]},{"name":"vision_brake_lights_command","description":"Command to have the vision board illuminate or turn off the brake lights","id":689,"data":[{"name":"lights","type":"bitfield","bits":[{"name":"brake_lights"},{"name":"spare_1"},{"name":"spare_2"},{"name":"spare_3"}]}]},{"name":"vision_headlights_command","description":"Command to have the vision board illuminate or turn off the headlights and high beams","id":690,"data":[{"name":"lights","type":"bitfield","bits":[{"name":"headlights"},{"name":"high_beams"},{"name":"spare_1"},{"name":"spare_2"},{"name":"spare_3"}]},{"name":"brightness","type":"float"}]},{"name":"vision_horn_command","description":"Command the vision board honk the horn, must be repeatedly sent otherwise the vision board will stop honking after a bit. See high_power.h for details.","id":691,"data":[{"name":"horn","type":"bitfield","bits":[{"name":"horn"},{"name":"spare"}]}]},{"name":"vision_array_latches_command","description":"Command the vision board to open the array latches","id":692,"data":[{"name":"array_latches","type":"bitfield","bits":[{"name":"array_front"},{"name":"array_rear"}]}]},{"name":"vision_rearview_command","description":"Command the vision board turn on the rear view cameras","id":693,"data":[{"name":"cameras","type":"bitfield","bits":[{"name":"left"},{"name":"right"},{"name":"rear"}]}]},{"name":"tracker_enable","description":"Enables/disables power trackers. Use 0x610 for the channel transmitting the data packet on 0x600, 0x611 for 0x601, et cetera. Sending 1 in the enable byte turns the tracker on; sending 0 turns it off.","id":1552,"endian":"little","repeat":6,"offset":1,"data":[{"name":"enable","type":"uint8_t"}]},{"name":"distance_traveled","description":"distance of wavesculptor odometer","id":413,"endian":"little","data":[{"name":"trip_distance","type":"float","units":"m"}]},{"name":"charger_state","description":"Notifies whether the J1772 cable is plugged.","id":1395,"data":[{"name":"state_flags","type":"bitfield","bits":[{"name":"charger_plugged"}]},{"name":"charger_max_temp","type":"uint16_t","units":"C","conversion":0.001},{"name":"fault","type":"bitfield","bits":[{"name":"CHARGER_OVERVOLT"},{"name":"CHARGER_OVERTEMP"},{"name":"CHARGER_CAN_TIMEOUT"},{"name":"BATTERY_HV_KILL"},{"name":"BATTERY_UNDERVOLT"},{"name":"BATTERY_OVERVOLT"},{"name":"BATTERY_CELL_OVERTEMP"},{"name":"BATTERY_CAN_TIMEOUT"}]},{"name":"charging_current","type":"float","units":"A"}]},{"name":"charger_bms_request","description":"Request packet for sending contactor commands from the charger to BP.","id":116,"data":[{"name":"request_flags","type":"bitfield","bits":[{"name":"charging_requested"}]}]},{"name":"charger_current_voltage","description":"Packet to request charging current/voltage set","id":1398,"data":[{"name":"max_current","type":"float","units":"A"},{"name":"max_capacity","type":"float","units":"kWh"}]},{"name":"charger_power","description":"Outputs the amount of power that the chargers are delivering.","id":1399,"data":[{"name":"power","type":"float","units":"W"}]},{"name":"thunderstruck_control_message","description":"Control packet for thunderstruck chargers","id":417677348,"endian":"little","is_extended":true,"data":[{"name":"Enable","type":"uint8_t","units":"V","conversion":1},{"name":"CHARGE_VOLTAGE","type":"uint16_t","units":"V","conversion":1},{"name":"CHARGE_CURRENT","type":"uint16_t","units":"V","conversion":1},{"name":"LED_BLINK_PATTERN","type":"uint8_t","units":"V","conversion":1},{"name":"RESERVED","type":"uint16_t","units":"V","conversion":1}]},{"name":"vision_status_front","description":"Status of the front vision board outputs","id":694,"data":[{"name":"lights","type":"bitfield","bits":[{"name":"left_turn_signal"},{"name":"right_turn_signal"},{"name":"brake_lights"},{"name":"headlights"},{"name":"high_beams"},{"name":"spare_1"},{"name":"spare_2"},{"name":"spare_3"}]},{"name":"horn","type":"bitfield","bits":[{"name":"horn"},{"name":"spare"}]},{"name":"cameras","type":"bitfield","bits":[{"name":"left"},{"name":"right"},{"name":"rear"}]},{"name":"array_latches","type":"bitfield","bits":[{"name":"array_front_0"},{"name":"array_front_1"},{"name":"array_rear_0"},{"name":"array_rear_1"}]}]},{"name":"vision_status_rear","description":"Status of the rear vision board outputs","id":695,"data":[{"name":"lights","type":"bitfield","bits":[{"name":"left_turn_signal"},{"name":"right_turn_signal"},{"name":"brake_lights"},{"name":"headlights"},{"name":"high_beams"},{"name":"spare_1"},{"name":"spare_2"},{"name":"spare_3"}]},{"name":"horn","type":"bitfield","bits":[{"name":"horn"},{"name":"spare"}]},{"name":"cameras","type":"bitfield","bits":[{"name":"left"},{"name":"right"},{"name":"rear"}]},{"name":"array_latches","type":"bitfield","bits":[{"name":"array_front_0"},{"name":"array_front_1"},{"name":"array_rear_0"},{"name":"array_rear_1"}]}]},{"name":"lights_front_id","description":"Unique identification packet for front lights board","id":768,"data":[{"name":"board_id","type":"uint16_t"},{"name":"mcu_temp","type":"int16_t","units":"C","conversion":0.01},{"name":"bus_voltage","type":"uint16_t","units":"V","conversion":0.001},{"name":"fault_code","type":"uint16_t"}]},{"name":"lights_back_id","description":"Unique identification packet for back lights board","id":769,"data":[{"name":"board_id","type":"uint16_t"},{"name":"mcu_temp","type":"int16_t","units":"C","conversion":0.01},{"name":"bus_voltage","type":"uint16_t","units":"V","conversion":0.001},{"name":"fault_code","type":"uint16_t"}]},{"name":"vision_id","description":"Unique identification packet for vision","id":770,"data":[{"name":"board_id","type":"uint16_t"},{"name":"mcu_temp","type":"int16_t","units":"C","conversion":0.01},{"name":"bus_voltage","type":"uint16_t","units":"V","conversion":0.001},{"name":"fault_code","type":"uint16_t"}]},{"name":"steering_press_count_1","description":"Shows whether each button has been toggled an even (\"on\") or odd (\"off\") number of times.","id":576,"data":[{"name":"button0","type":"uint8_t"},{"name":"button1","type":"uint8_t"},{"name":"button2","type":"uint8_t"},{"name":"button3","type":"uint8_t"},{"name":"button4","type":"uint8_t"},{"name":"button5","type":"uint8_t"},{"name":"button6","type":"uint8_t"}]},{"name":"steering_press_count_2","description":"Shows whether each button has been toggled an even (\"on\") or odd (\"off\") number of times.","id":592,"data":[{"name":"button7","type":"uint8_t"},{"name":"button8","type":"uint8_t"},{"name":"button9","type":"uint8_t"},{"name":"button10","type":"uint8_t"}]},{"name":"steering_button_colors_1","description":"This packet controls each button's color. Each byte is a hex color code.","id":577,"data":[{"name":"button0","type":"uint8_t"},{"name":"button1","type":"uint8_t"},{"name":"button2","type":"uint8_t"},{"name":"button3","type":"uint8_t"},{"name":"button4","type":"uint8_t"},{"name":"button5","type":"uint8_t"},{"name":"button6","type":"uint8_t"}]},{"name":"steering_button_colors_2","description":"This packet controls each button's color. Each byte is a hex color code.","id":593,"data":[{"name":"button7","type":"uint8_t"},{"name":"button8","type":"uint8_t"},{"name":"button9","type":"uint8_t"},{"name":"button10","type":"uint8_t"}]},{"name":"steering_horn","description":"This packet controls the state of the horn.","id":578,"data":[{"name":"horn","type":"uint8_t"}]},{"name":"thunderstruck_status_message","description":"Status packet for thunderstruck chargers","id":418063424,"endian":"little","is_extended":true,"data":[{"name":"STATUS_FLAGS","type":"uint8_t","units":"V","conversion":1},{"name":"CHARGE_FLAGS","type":"uint8_t","units":"V","conversion":1},{"name":"OUTPUT_VOLTAGE","type":"uint16_t","units":"V","conversion":1},{"name":"OUTPUT_CURRENT","type":"uint16_t","units":"V","conversion":1},{"name":"CHARGER_TEMP","type":"uint8_t","units":"V","conversion":1},{"name":"RESERVED","type":"uint8_t","units":"V","conversion":1}]},{"name":"tracker_data","description":"Tracker data. Each channel transmits on a specific ID, which should be specified along with the tracker, most likely 0x600-0x603.","id":1536,"endian":"little","repeat":6,"offset":1,"data":[{"name":"array_voltage","type":"uint16_t","units":"V","conversion":0.01},{"name":"array_current","type":"uint16_t","units":"A","conversion":0.001},{"name":"battery_voltage","type":"uint16_t","units":"V","conversion":0.01},{"name":"temperature","type":"uint16_t","units":"C","conversion":0.01}]},{"name":"tritium_motor_drive_l","description":"Tritium Motor Drive Command","id":289,"endian":"little","data":[{"name":"motor_velocity","type":"float"},{"name":"motor_current","type":"float"}]},{"name":"tritium_motor_power_l","description":"Tritium Motor Power Command","id":290,"endian":"little","data":[{"name":"reserved","type":"float"},{"name":"bus_current","type":"float"}]},{"name":"tritium_reset_l","description":"Tritium Reset Command","id":291,"endian":"little","data":[{"name":"unused1","type":"float"},{"name":"unused2","type":"float"}]},{"name":"tritium_motor_drive_r","description":"Tritium Motor Drive Command","id":353,"endian":"little","data":[{"name":"motor_velocity","type":"float"},{"name":"motor_current","type":"float"}]},{"name":"tritium_motor_power_r","description":"Tritium Motor Power Command","id":354,"endian":"little","data":[{"name":"reserved","type":"float"},{"name":"bus_current","type":"float"}]},{"name":"tritium_reset_r","description":"Tritium Reset Command","id":355,"endian":"little","data":[{"name":"unused1","type":"float"},{"name":"unused2","type":"float"}]},{"name":"bms_ah_set","description":"write state of charge, use with caution","id":22,"endian":"little","data":[{"name":"ah","type":"uint32_t","conversion":0.00001}]},{"name":"bms_wh_set","description":"write state of charge, use with caution","id":23,"endian":"little","data":[{"name":"wh","type":"uint32_t","conversion":0.00001}]},{"name":"bms_kill","description":"packet to cause BMS kill","id":26,"endian":"little","data":[{"name":"kill_type","type":"bitfield","bits":[{"name":"KILL_HARD"}]}]},{"name":"telemetry_rtc_reset","description":"Reset telemetry's real-time clock (RTC).","id":1792,"data":[{"name":"year","type":"uint8_t"},{"name":"month","type":"uint8_t"},{"name":"day","type":"uint8_t"},{"name":"hour","type":"uint8_t"},{"name":"minute","type":"uint8_t"},{"name":"second","type":"uint8_t"}]},{"name":"wsr_identification","description":"WS RIGHT Identification Information","id":320,"endian":"little","data":[{"name":"tritium_id","type":"uint32_t"},{"name":"serial_number","type":"uint32_t"}]},{"name":"wsr_status_information","description":"WS RIGHT Status Information","id":321,"endian":"little","data":[{"name":"limit_flags","type":"bitfield","bits":[{"name":"output_voltage_pwm"},{"name":"motor_current"},{"name":"velocity"},{"name":"bus_current"},{"name":"bus_voltage_upper_limit"},{"name":"bus_voltage_lower_limit"},{"name":"ipm_temperature_or_motor_temperature"},{"name":"reserved"}]},{"name":"limit_flags_reserved","type":"uint8_t"},{"name":"error_flags_0","type":"bitfield","bits":[{"name":"hardware_over_current"},{"name":"software_over_current"},{"name":"dc_bus_over_voltage"},{"name":"bad_motor_position_hall_sequence"},{"name":"watchdog_caused_last_reset"},{"name":"config_read_error"},{"name":"lv_rail_under_voltage_lock_out"},{"name":"desaturation_fault"}]},{"name":"error_flags_1","type":"bitfield","bits":[{"name":"motor_over_speed"},{"name":"reserved_9"},{"name":"reserved_10"},{"name":"reserved_11"},{"name":"reserved_12"},{"name":"reserved_13"},{"name":"reserved_14"},{"name":"reserved_15"}]},{"name":"active_motor","type":"uint16_t"},{"name":"reserved","type":"uint16_t"}]},{"name":"wsr_bus_measurement","description":"WS RIGHT Bus Measurement","id":322,"endian":"little","data":[{"name":"bus_voltage","type":"float","units":"V"},{"name":"bus_current","type":"float","units":"A"}]},{"name":"wsr_velocity","description":"WS RIGHT Velocity Measurement","id":323,"endian":"little","data":[{"name":"motor_velocity","type":"float","units":"rpm"},{"name":"vehicle_velocity","type":"float","units":"m/s"}]},{"name":"wsr_phase_current","description":"WS RIGHT Phase Current Measurement","id":324,"endian":"little","data":[{"name":"phase_b_current","type":"float","units":"A rms"},{"name":"phase_c_current","type":"float","units":"A rms"}]},{"name":"wsr_motor_voltage_vector","description":"WS RIGHT Motor Voltage Vector Measurement","id":325,"endian":"little","data":[{"name":"vq","type":"float","units":"V"},{"name":"vd","type":"float","units":"V"}]},{"name":"wsr_motor_current_vector","description":"WS RIGHT Motor Current Vector Measurement","id":326,"endian":"little","data":[{"name":"iq","type":"float","units":"A"},{"name":"id","type":"float","units":"A"}]},{"name":"wsr_motor_backemf","description":"WS RIGHT Motor BackEMF Measurement / Prediction","id":327,"endian":"little","data":[{"name":"bemfq","type":"float","units":"V"},{"name":"bemfd","type":"float","units":"V"}]},{"name":"wsr_15_165_voltage_rail","description":"WS RIGHT 15 and 1.65 Voltage Rail Measurement","id":328,"endian":"little","data":[{"name":"reference_165v","type":"float","units":"V"},{"name":"supply_15v","type":"float","units":"V"}]},{"name":"wsr_25_12_voltage_rail","description":"WS RIGHT 2.5V and 1.2V Voltage Rail Measurement","id":329,"endian":"little","data":[{"name":"supply_12v","type":"float","units":"V"},{"name":"supply_25v","type":"float","units":"V"}]},{"name":"wsr_heatsink_motor_temp","description":"WS RIGHT Heat-sink \u0026 Motor Temperature Measurement","id":331,"endian":"little","data":[{"name":"motor_temp","type":"float","units":"C"},{"name":"heatsink_temp","type":"float","units":"C"}]},{"name":"wsr_dsp_board_temp","description":"WS RIGHT DPS Board Temperature Measurement","id":332,"endian":"little","data":[{"name":"dsp_board_temp","type":"float","units":"C"},{"name":"reserved","type":"float","units":"C"}]},{"name":"wsr_reserved","description":"WS RIGHT Reserved","id":333,"endian":"little","data":[{"name":"reserved0","type":"float"},{"name":"reserved1","type":"float"}]},{"name":"wsr_odometer_bus_amphours_measurement","description":"WS RIGHT Odometer and Bus AmpHours Measurement","id":334,"endian":"little","data":[{"name":"odometer","type":"float","units":"m"},{"name":"dc_bus_amphours","type":"float","units":"Ah"}]},{"name":"wsr_slip_speed_measurement","description":"WS RIGHT Slip Speed Measurement","id":343,"endian":"little","data":[{"name":"reserved","type":"float","units":"C"},{"name":"slip_speed","type":"float","units":"Hz"}]},{"name":"wsl_identification","description":"WS LEFT Identification Information","id":256,"endian":"little","data":[{"name":"tritium_id","type":"uint32_t"},{"name":"serial_number","type":"uint32_t"}]},{"name":"wsl_status_information","description":"WS LEFT Status Information","id":257,"endian":"little","data":[{"name":"limit_flags","type":"bitfield","bits":[{"name":"output_voltage_pwm"},{"name":"motor_current"},{"name":"velocity"},{"name":"bus_current"},{"name":"bus_voltage_upper_limit"},{"name":"bus_voltage_lower_limit"},{"name":"ipm_temperature_or_motor_temperature"},{"name":"reserved"}]},{"name":"limit_flags_reserved","type":"uint8_t"},{"name":"error_flags_0","type":"bitfield","bits":[{"name":"hardware_over_current"},{"name":"software_over_current"},{"name":"dc_bus_over_voltage"},{"name":"bad_motor_position_hall_sequence"},{"name":"watchdog_caused_last_reset"},{"name":"config_read_error"},{"name":"lv_rail_under_voltage_lock_out"},{"name":"desaturation_fault"}]},{"name":"error_flags_1","type":"bitfield","bits":[{"name":"motor_over_speed"},{"name":"reserved_9"},{"name":"reserved_10"},{"name":"reserved_11"},{"name":"reserved_12"},{"name":"reserved_13"},{"name":"reserved_14"},{"name":"reserved_15"}]},{"name":"active_motor","type":"uint16_t"},{"name":"reserved","type":"uint16_t"}]},{"name":"wsl_bus_measurement","description":"WS LEFT Bus Measurement","id":258,"endian":"little","data":[{"name":"bus_voltage","type":"float","units":"V"},{"name":"bus_current","type":"float","units":"A"}]},{"name":"wsl_velocity","description":"WS LEFT Velocity Measurement","id":259,"endian":"little","data":[{"name":"motor_velocity","type":"float","units":"rpm"},{"name":"vehicle_velocity","type":"float","units":"m/s"}]},{"name":"wsl_phase_current","description":"WS LEFT Phase Current Measurement","id":260,"endian":"little","data":[{"name":"phase_b_current","type":"float","units":"A rms"},{"name":"phase_c_current","type":"float","units":"A rms"}]},{"name":"wsl_motor_voltage_vector","description":"WS LEFT Motor Voltage Vector Measurement","id":261,"endian":"little","data":[{"name":"vq","type":"float","units":"V"},{"name":"vd","type":"float","units":"V"}]},{"name":"wsl_motor_current_vector","description":"WS LEFT Motor Current Vector Measurement","id":262,"endian":"little","data":[{"name":"iq","type":"float","units":"A"},{"name":"id","type":"float","units":"A"}]},{"name":"wsl_motor_backemf","description":"WS LEFT Motor BackEMF Measurement / Prediction","id":263,"endian":"little","data":[{"name":"bemfq","type":"float","units":"V"},{"name":"bemfd","type":"float","units":"V"}]},{"name":"wsl_15_165_voltage_rail","description":"WS LEFT 15 and 1.65 Voltage Rail Measurement","id":264,"endian":"little","data":[{"name":"reference_165v","type":"float","units":"V"},{"name":"supply_15v","type":"float","units":"V"}]},{"name":"wsl_25_12_voltage_rail","description":"WS LEFT 2.5V and 1.2V Voltage Rail Measurement","id":265,"endian":"little","data":[{"name":"supply_12v","type":"float","units":"V"},{"name":"supply_25v","type":"float","units":"V"}]},{"name":"wsl_heatsink_motor_temp","description":"WS LEFT Heat-sink \u0026 Motor Temperature Measurement","id":267,"endian":"little","data":[{"name":"motor_temp","type":"float","units":"C"},{"name":"heatsink_temp","type":"float","units":"C"}]},{"name":"wsl_dsp_board_temp","description":"WS LEFT DPS Board Temperature Measurement","id":268,"endian":"little","data":[{"name":"dsp_board_temp","type":"float","units":"C"},{"name":"reserved","type":"float","units":"C"}]},{"name":"wsl_odometer_bus_amphours_measurement","description":"WS LEFT Odometer and Bus AmpHours Measurement","id":270,"endian":"little","data":[{"name":"odometer","type":"float","units":"m"},{"name":"dc_bus_amphours","type":"float","units":"Ah"}]},{"name":"wsl_reserved","description":"WS LEFT Reserved","id":269,"endian":"little","data":[{"name":"reserved0","type":"float"},{"name":"reserved1","type":"float"}]},{"name":"wsl_slip_speed_measurement","description":"WS LEFT Slip Speed Measurement","id":279,"endian":"little","data":[{"name":"reserved","type":"float","units":"C"},{"name":"slip_speed","type":"float","units":"Hz"}]}],"boards":[{"name":"bms","transmit":["bms_measurement","bms_capacity","bms_charger_response","battery_status","bms_kill_reason","bms_module_min_max","bms_soc","bms_currentlimit","bms_fan_info","bms_module"],"receive":["bms_kill","bms_wh_set","bms_ah_set","bms_set_min_fan_speed","charger_bms_request","chassis_isolation_fault"]},{"name":"bridge_board","transmit":["chassis_isolation_fault"],"receive":["bms_imd_info","battery_status"]},{"name":"charger","transmit":["charger_state","charger_bms_request","charger_power","thunderstruck_control_message"],"receive":["bms_charger_response","battery_status","bms_module_min_max","bms_measurement","charger_current_voltage","bms_capacity","thunderstruck_status_message"]},{"name":"flight_computer","transmit":["tracker_enable","vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","vision_horn_command","tritium_motor_drive_l","tritium_motor_drive_r","steering_button_colors_1","steering_button_colors_2","tritium_reset_l","tritium_reset_r","dashboard_pedal_percentages","car_state","car_speed","dashboard_pedal_fault","flight_computer_hv_board_disconnect_counts","flight_computer_lv_board_disconnect_counts","flight_computer_internal_state","power_to_drive","array_power","array_energy","distance_traveled"],"receive":["bms_module_min_max","charger_state","steering_press_count_1","steering_press_count_2","wsl_velocity","wsr_velocity","steering_horn","bms_kill_reason","bms_measurement","tracker_data","vision_status_front","vision_status_rear","wsl_odometer_bus_amphours_measurement","array_energy_reset","wsr_odometer_bus_amphours_measurement"]},{"name":"g4_example","transmit":["vision_status_front","vision_headlights_command","demo_packet"],"receive":["vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","vision_horn_command","demo_packet"]},{"name":"lights","transmit":["vision_status_front","vision_status_rear","lights_front_id","lights_back_id"],"receive":["vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","bms_kill_reason"]},{"name":"skylab2_demo","transmit":["vision_status_front","vision_headlights_command"],"receive":["vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","vision_horn_command"]},{"name":"steering","transmit":["steering_press_count_1","steering_press_count_2","steering_horn"],"receive":["steering_button_colors_1","steering_button_colors_2"]},{"name":"vision","transmit":["vision_status_front","vision_id"],"receive":["vision_turn_signals_command","vision_brake_lights_command","vision_headlights_command","vision_horn_command","vision_array_latches_command","vision_rearview_command"]}]}` diff --git a/skylab/templates/golang.go.tmpl b/skylab/templates/golang.go.tmpl index 8fb7b7d..897a3b2 100644 --- a/skylab/templates/golang.go.tmpl +++ b/skylab/templates/golang.go.tmpl @@ -46,7 +46,7 @@ type {{$structName}} struct { } func (p *{{$structName}}) CanId() (can.CanID, error) { - c := can.CanID{Extended: {{.Extended}}} + c := can.CanID{Extended: {{.IsExtended}}} {{- if .Repeat }} if p.Idx >= {{.Repeat}} { return c, &UnknownIdError{ {{ printf "0x%X" .Id }} } @@ -108,10 +108,10 @@ var idMap = map[can.CanID]bool{ {{ range $p := .Packets -}} {{ if $p.Repeat }} {{ range $idx := Nx (int $p.Id) $p.Repeat $p.Offset -}} - { Id: {{ $idx | printf "0x%X"}}, Extended: {{$p.Extended}} }: true, + { Id: {{ $idx | printf "0x%X"}}, Extended: {{$p.IsExtended}} }: true, {{ end }} {{- else }} - { Id: {{ $p.Id | printf "0x%X" }}, Extended: {{$p.Extended}} }: true, + { Id: {{ $p.Id | printf "0x%X" }}, Extended: {{$p.IsExtended}} }: true, {{- end}} {{- end}} }