RL on Simple Arm model: assign a force

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Oskar Åsbrink
Posts: 5
Joined: Fri Mar 26, 2021 12:29 am

RL on Simple Arm model: assign a force

Post by Oskar Åsbrink » Tue Apr 27, 2021 10:09 am

Hello
Im quite new to the API and I could use some guidance. I'm trying to run a given RL model on any model with one muscle.I have been instructed to not use the opensim-rl framework for now.

I'm trying to run the python build_simple_arm_model script with the DRL model. First step for me is to simply be able to activate the muscle with a given force(in Newton for past uses in RL model) and output the angle.

The Millard2012EquilibriumMuscle is given a Max isometric force, but his is not the active force that is being applied?
What is being used in the example is the prescribed controller but I suspect this is not what I should use in this case. There seems to be lots of factors in to what makes the forceset/fiber_force values

TLDR
how can I simply set the force for the "bicep" muscle to be contracted?

snippet of the current muscle and controller code:

Code: Select all

biceps = osim.Millard2012EquilibriumMuscle("biceps",  # Muscle name
                                           100.0,  # Max isometric force,"Maximum isometric force that the fibers can generate"
                                           0.8,  # Optimal fibre length
                                           0.35,  # Tendon slack length, "Resting length of the tendon"
                                           0.0)  # Pennation angle
################ the controller

brain = osim.PrescribedController()
brain.addActuator(biceps)

brain.prescribeControlForActuator("biceps",osim.StepFunction(0.1, 0.5, 0.1, 10.0))
Appreciate any help
Oskar

Tags:

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: RL on Simple Arm model: assign a force

Post by Thomas Uchida » Tue Apr 27, 2021 12:17 pm

The Millard2012EquilibriumMuscle is given a Max isometric force, but his is not the active force that is being applied?
The maximum isometric force is the force the muscle will produce when maximally activated at its optimal fiber length and with zero velocity. Details about the muscle model can be found on the "Muscle Model Theory and Publications" section in the documentation (https://simtk-confluence.stanford.edu/d ... blications).
how can I simply set the force for the "bicep" muscle to be contracted?
You can replace the muscle with a PathActuator (see the documentation here: https://simtk.org/api_docs/opensim/api_ ... ml#details). The "hopper" example might be helpful as a reference: https://github.com/opensim-org/opensim- ... pperDevice.

User avatar
Oskar Åsbrink
Posts: 5
Joined: Fri Mar 26, 2021 12:29 am

Re: RL on Simple Arm model: assign a force

Post by Oskar Åsbrink » Thu May 06, 2021 5:38 am

tkuchida wrote:
Tue Apr 27, 2021 12:17 pm
The Millard2012EquilibriumMuscle is given a Max isometric force, but his is not the active force that is being applied?
The maximum isometric force is the force the muscle will produce when maximally activated at its optimal fiber length and with zero velocity. Details about the muscle model can be found on the "Muscle Model Theory and Publications" section in the documentation (https://simtk-confluence.stanford.edu/d ... blications).
how can I simply set the force for the "bicep" muscle to be contracted?
You can replace the muscle with a PathActuator (see the documentation here: https://simtk.org/api_docs/opensim/api_ ... ml#details). The "hopper" example might be helpful as a reference: https://github.com/opensim-org/opensim- ... pperDevice.
having some progress. thanks for your advice

POST REPLY