mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-22 08:04:07 +08:00
fix HWIL tests
This commit is contained in:
@@ -258,6 +258,7 @@ interfaces:
|
||||
Setting this to False even though a brake resistor is connected is
|
||||
harmless. Setting this to True even though no brake resistor is
|
||||
connected can break the power supply.
|
||||
Changes to this value require a reboot to take effect.
|
||||
|
||||
dc_bus_undervoltage_trip_level:
|
||||
type: float32
|
||||
|
||||
@@ -40,6 +40,9 @@ class TestClosedLoopControlBase():
|
||||
|
||||
# Set brake resistor settings
|
||||
axis_ctx.parent.handle.config.brake_resistance = float(axis_ctx.parent.yaml['brake-resistance'])
|
||||
# The docs say this requires a reboot but here's a small secret:
|
||||
# Since the brake resistor is also started in clear_errors() this
|
||||
# circumvents the need for a reboot.
|
||||
axis_ctx.parent.handle.config.enable_brake_resistor = True
|
||||
|
||||
# Set calibration settings
|
||||
|
||||
@@ -106,6 +106,8 @@ class TestSimpleCANClosedLoop():
|
||||
# Make sure there are no funny configurations active
|
||||
logger.debug('Setting up clean configuration...')
|
||||
axis_ctx.parent.erase_config_and_reboot()
|
||||
axis_ctx.parent.handle.config.enable_brake_resistor = True
|
||||
axis_ctx.parent.save_config_and_reboot()
|
||||
|
||||
# run calibration
|
||||
axis_ctx.handle.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
|
||||
@@ -162,7 +164,7 @@ class TestSimpleCANClosedLoop():
|
||||
test_assert_eq(axis_ctx.handle.config.can.node_id, node_id+20)
|
||||
|
||||
# Reset node ID to default value
|
||||
asyncio.run(command(canbus.handle, node_id+20, extended_id, 'set_node_id', node_id=node_id))
|
||||
command(canbus.handle, node_id+20, extended_id, 'set_node_id', node_id=node_id)
|
||||
fence()
|
||||
test_assert_eq(axis_ctx.handle.config.can.node_id, node_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user