This work expanded on our prior study WCCI2024Impedance, in which we built a simulation tool for physical interaction between an elbow and an exoskeleton in MyoSuite to study the human similarity of a reinforcement learning (RL) agent in controlling an elbow musculoskeletal model. We newly added a stretch reflex controller unit into the simulation tool to enable the simulation of spasticity models on the virtual elbow. Afterwards, we simulated the robot-assisted constant-velocity stretch experiment for four types of spasticity models to explore the optimal modelling method of elbow spasticity.
python3 -m venv .venv
# active your venv
git clone --recursive https://github.com/myo-manipulation/SpasticMyoElbow.git
pip install -r requirements
pip install -e .
The codes for this project is in 'dev' folder:
- use check_mode.ipynb to observe the model utilised in this project
- use test_environment.py to test the configuration and installation of your environment
- test_spasticity_model.py is an initial version of the code for spasticity simulation, where you can understand how the spasticity model is implemented into the myosuite environment. You can define a passive movement applied by the exo on the eblow and check how the spasticity will affect the torque response of the elbow joint.
- model_validation_experiment.py is a further step of test_spasticity_model.py, which allows inputing a series of reference trajectories of elbow extension and recording the time, angle, and torque. It reads ref_data_0.pkl or ref_data_0_1.pkl in 'validation_data' folder, the dataset extracted from 'Biomechanical parameters of the elbow stretch reflex in chronic hemiparetic stroke', as the reference trajectories. model_validation_experiment.py can generate the dataset of spasticity model validation saved in 'validation_data/gain_xx_x_x'. You can observe the refernece dataset and simulation results through model.validation.ipynb
- new_model_validation.py: an upgrade of model_validation_experiment.py, which enables the hybird model of spasticity. It allows inputing a series of reference trajectories of elbow extension and recording the time, angle, and torque. It reads ref_data_0_1.pkl in 'data' folder. New_model_validation.py can generate the dataset of spasticity model validation saved in 'data/sim_data2'. You can observe the refernece dataset and simulation results through '/figures/ICORR_simdata2.ipynb'.
- We then further improved new_model_validation.py to new_model_fitting.py to find the best parameters for the hybird model of spasticity (TBD).
The dataset for this project is in 'data' folder:
- data/passive_force: data for passive resistance calibration
- data/sim_data1: validation dataset for the single-feedback spasticity model
- data/sim_data2: validation dataset for the multiple-feedback spasticity model
- ref_data_0_1.pkl: the reference torque and angle data from a healthy people
- ref_data_1.csv: the reference data extracted from 'Biomechanical parameters of the elbow stretch reflex in chronic hemiparetic stroke'.
SpasticMyoElbow is licensed under the Apache License.
If you find this repository useful in your research, please consider giving a star ⭐ and cite our arXiv paper by using the following BibTeX entrys.
@Misc{SpasticMyoElbow2024,
}