Skip to content

Commit

Permalink
Add support for new estops + up the min voltage for battery warnings (#…
Browse files Browse the repository at this point in the history
…2925)

* estop

* up min battery voltage

* 22.6 is above nominal
  • Loading branch information
LiCody authored Jun 10, 2023
1 parent 13838a4 commit adb7085
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shared/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static const unsigned int MAX_ROBOT_IDS = MAX_ROBOT_IDS_PER_SIDE * 2;
static const unsigned NUM_CELLS_IN_BATTERY = 3;
static const unsigned NUM_BATTERIES_IN_SERIES = 2;
static const double MAX_SINGLE_CELL_VOLTAGE = 4.2;
static const double MIN_SINGLE_CELL_VOLTAGE = 3.2 + 0.1; // +0.1v headroom
static const double MIN_SINGLE_CELL_VOLTAGE = 3.5 + 0.1; // +0.1v headroom

static const double MIN_BATTERY_VOLTAGE =
MIN_SINGLE_CELL_VOLTAGE * NUM_CELLS_IN_BATTERY * NUM_BATTERIES_IN_SERIES;
Expand Down
2 changes: 1 addition & 1 deletion src/software/thunderscope/robot_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(
multicast_channel,
interface,
disable_estop,
estop_path="/dev/ttyACM0",
estop_path,
estop_buadrate=115200,
):
"""Initialize the communication with the robots
Expand Down
6 changes: 6 additions & 0 deletions src/software/thunderscope/thunderscope_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,17 @@
# else, it will be the diagnostics proto
current_proto_unix_io = tscope.proto_unix_io_map[ProtoUnixIOTypes.CURRENT]

# different estops use different ports this detects which one to use based on what is plugged in
estop_path = (
"/dev/ttyACM0" if os.path.isfile("/dev/ttyACM0") else "/dev/ttyUSB0"
)

with RobotCommunication(
current_proto_unix_io,
getRobotMulticastChannel(0),
args.interface,
args.disable_estop,
estop_path,
) as robot_communication:
if args.run_diagnostics:
for tab in tscope_config.tabs:
Expand Down

0 comments on commit adb7085

Please sign in to comment.