Skip to content

Commit

Permalink
Add missing flags to heartbeat message
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetmelon committed Sep 23, 2021
1 parent e0aaa04 commit b92677d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions tools/create_can_dbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@

# 0x001 - Heartbeat
axisError = cantools.database.can.Signal("Axis_Error", 0, 32)
axisState = cantools.database.can.Signal("Axis_State", 32, 32)
axisState = cantools.database.can.Signal("Axis_State", 32, 8)
motorFlags = cantools.database.can.Signal("Motor_Flags", 40, 8)
encoderFlags = cantools.database.can.Signal("Encoder_Flags", 48, 8)
controllerFlags = cantools.database.can.Signal("Controller_Flags", 56, 8)

heartbeatMsg = cantools.database.can.Message(
0x001, "Heartbeat", 8, [axisError, axisState]
0x001, "Heartbeat", 8, [axisError, axisState, motorFlags, encoderFlags, controllerFlags]
)

# 0x002 - E-Stop Message
Expand Down
5 changes: 4 additions & 1 deletion tools/odrive-cansimple.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ BU_:


BO_ 1 Heartbeat: 8 Vector__XXX
SG_ Axis_State : 32|32@1+ (1,0) [0|0] "" Vector__XXX
SG_ Controller_Flags : 56|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ Encoder_Flags : 48|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ Motor_Flags : 40|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ Axis_State : 32|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ Axis_Error : 0|32@1+ (1,0) [0|0] "" Vector__XXX

BO_ 2 Estop: 0 Vector__XXX
Expand Down

0 comments on commit b92677d

Please sign in to comment.