Skip to content

Commit

Permalink
dbw_sim can now run with errors
Browse files Browse the repository at this point in the history
Just told it to stop sending thing to the can bus, ie I comment those line out.
  • Loading branch information
sdekhterman committed Oct 24, 2024
1 parent 71647a9 commit 4dfea6f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dbw/dbw/dbw_vel_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self):
self.timer = self.create_timer(0.1, self.timer_callback)

# init can
self.bus = can.Bus(interface='socketcan', channel='can0', bitrate=250000)
# self.bus = can.Bus(interface='socketcan', channel='can0', bitrate=250000)

# init varibables
self.count = 0
Expand Down Expand Up @@ -51,14 +51,14 @@ def __init__(self):
self.inhibitCmd = can.Message(arbitration_id=0x0CFE5A2A, data=[0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF], is_extended_id=True)

# send address claim message
self.bus.send(self.addressClaim)
# self.bus.send(self.addressClaim)

def timer_callback(self):
self.bus.send(self.inhibitCmd)
# self.bus.send(self.inhibitCmd)

self.count += 1
if self.count == 10:
self.bus.send(self.heartBeat)
# self.bus.send(self.heartBeat)
self.count = 0

propulsion_msg = UInt8MultiArray()
Expand Down Expand Up @@ -124,7 +124,7 @@ def dbw_callback(self, msg):
else:
self.inhibitCmd.data[4] = 0x00

self.bus.send(self.propulsion)
# self.bus.send(self.propulsion)

print('sending control command')

Expand Down

0 comments on commit 4dfea6f

Please sign in to comment.