Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
899c94c
Added MailBox and PostOffice. Working demo with gui_thread.
nundinir Jun 13, 2025
b3086b0
added tests for Exboot_Postal_Service.py methods. Added docstrings, a…
nundinir Jun 14, 2025
62eebdc
modified logging to better track Postal Service Performance. Seems li…
nundinir Jun 15, 2025
9fc6577
renamed postoffice and mailbox class to be something more descriptive
nundinir Jun 15, 2025
68c2323
cleaned up exoboots.py so that errors from merging are resolved. also…
nundinir Jun 15, 2025
88ed818
fixed more merge mistakes in exoboots.py. also made a lil bit more pr…
nundinir Jun 15, 2025
e69dddd
fixed another merge error in the exoboots.py code. also added messagi…
nundinir Jun 16, 2025
4bba622
added several todos...threading demo not sending msgs consistently.
nundinir Jun 16, 2025
083a9e1
added in exoboot stopping. modified walking simulator to directly sen…
nundinir Jun 16, 2025
56f351a
modified non_singleton_logger to handle csv logging. tested csv loggi…
nundinir Jun 17, 2025
fed38f1
fixed exoboots.py and JIM_testing script merge errors.
nundinir Jun 17, 2025
d114c88
updated JIM testing script to include buffer time for JIM alignment m…
nundinir Jun 17, 2025
a26fdca
fixed threads not quitting upon ctrl+c signal. was incorrectly settin…
nundinir Jun 19, 2025
c24b94d
added method to actuator thread to prevent peak torque setpoints from…
nundinir Jun 19, 2025
99b7e04
initial threading demo testing with actual exos complete! both exos s…
nundinir Jun 20, 2025
c48bbe7
added continuous mode flag and comments to gse_imu
nundinir Jun 22, 2025
4c30fc4
added flag for toggling creation of GSE_thread, since we may not alwa…
nundinir Jun 22, 2025
6b6061d
added in continuous flag back in since for some reason it didn't get …
nundinir Jun 22, 2025
edbcf11
ensured that the set_new_timing_params() in assistance_calculator pro…
nundinir Jun 22, 2025
30038e6
added in class that recieves data from actuators and plots to rtplot …
nundinir Jun 22, 2025
b4da2a4
added flexibile rtplotting vars for both actuators in MainThreadMessa…
nundinir Jun 23, 2025
efbc46d
tested and verified that main message receptor now recieves messages …
nundinir Jun 23, 2025
ea74020
Bertec_Estimator fixes and changes. Added TIME_METHOD for consistency…
nundinir Jun 23, 2025
ebb012a
random changes
nundinir Jun 23, 2025
e220621
added .mat file for gse_imu tuning and also added to gitignore
nundinir Jun 24, 2025
092b402
refactored TR_characterizer to use the flexsea library directly. test…
nundinir Jun 24, 2025
662043f
misc edits
nundinir Jun 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
*.pyc
*.log
py39-venv/
py311-venv/
py311-venv/
*.mat
118 changes: 0 additions & 118 deletions Exoboot_Postal_Service.py

This file was deleted.

42 changes: 27 additions & 15 deletions dephyEB51.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
TEST_TR_FILE
)
from src.exo.variable_transmission_ratio import VariableTransmissionRatio
from gse_imu import IMU_Estimator


class DephyEB51Actuator(DephyLegacyActuator):
Expand Down Expand Up @@ -63,6 +64,7 @@ def __init__(
dephy_log: bool = False,
offline: bool = False,
gear_ratio: float = 1.0,
imu_estimator: object = None
) -> None:

CONSOLE_LOGGER.info("Initializing DephyEB51 actuator...")
Expand Down Expand Up @@ -109,9 +111,11 @@ def __init__(
self.case_temp_buffer = []

# instantiate transmission ratio getter which uses motor-angle curve coefficients from pre-performed calibration
self.tr_gen = VariableTransmissionRatio(self.side, TEST_TR_FILE)
self.tr_gen = VariableTransmissionRatio(self.side)
CONSOLE_LOGGER.info("instantiated variable transmission ratio")

# instantiate IMU-based gait-state estimator
self.imu_estimator = IMU_Estimator()

def update_gear_ratio(self)-> None:
"""
Expand All @@ -131,9 +135,10 @@ def ankle_angle(self) -> float:
Ankle angle is in ° and is the angle of the ankle joint using the ankle encoder. Angles should range anywhere from 0° to 140°.
"""

# TODO look over ank_ang/100 versus ank_ang*ENC_CLICKS_TO_DEG
if self._data is not None:
ank_ang_in_deg = self.ank_ang/100
return float( (self.ank_enc_sign * ank_ang_in_deg) - self.tr_gen.get_offset() )
ank_ang_in_deg = self.ank_ang * EB51_CONSTANTS.MOT_ENC_CLICKS_TO_DEG
return float((self.ank_enc_sign * ank_ang_in_deg) - self.tr_gen.get_offset())
else:
LOGGER.debug(
msg="Actuator data is none, please ensure that the actuator is connected and streaming. Returning 0.0."
Expand All @@ -145,15 +150,29 @@ def update(self):
Updates the actuator state.
"""

# filter the temperature before updating the thermal model
self.filter_temp()

# update the actuator state
# super().update_allData()
super().update()

# filter the temperature before updating the thermal model
self.filter_temp()

# update the gear ratio
self.update_gear_ratio()

# update gait state estimate
self.imu_estimator.update(self.accelz, self.ankle_angle)

def get_imu_gait_state_estimate(self, var:str):
"""
Returns the IMU's gait state estimate

Args:
- desired variable from imu estimate to return
"""
state_dict = self.imu_estimator.return_estimate()

return state_dict[var]

def assign_id_to_side(self)-> str:
"""
Expand All @@ -167,15 +186,11 @@ def spool_belt(self):

LOGGER.info(
f"Spooling {self.side} joint. "
"Please make sure the joint is free to move and press Enter to continue."
"Please make sure the joint is free to move."
)

input()
self.set_motor_current(value=self.motor_sign * EXO_DEFAULT_CONFIG.BIAS_CURRENT) # in mA

time.sleep(0.3)


def filter_temp(self):
"""
Filters the case temperature to remove any spikes.
Expand All @@ -197,7 +212,6 @@ def filter_temp(self):

CONSOLE_LOGGER.warning(f"HAD TO ANTI-SPIKE the TEMP: {self.case_temperature}")


def torque_to_current(self, torque: float) -> int:
"""
Converts torque setpoint (Nm) to a corresponding current (in mA)
Expand All @@ -220,8 +234,6 @@ def torque_to_current(self, torque: float) -> int:

return int(des_current)



def current_to_torque(self)-> float:
"""
Converts current setpoint (in mA) to a corresponding torque (in Nm)
Expand All @@ -248,4 +260,4 @@ def JIM_torque_to_current(self, inst_torque: float) -> int:
"""
pass

# TODO: Add method to home the exos at standing angle
# TODO: Add method to home the exos at standing angle
Loading