Proper opensim ros muscle interface usage



I’m using the gazebo from the NRP to simulate my own OpenSim Model. Currently, I have struggled with getting it moving. I then also tried to get the “opensim_knee_jerkt_tutorial” to move and it also didn’t work.

The ROS nodes created while inserting the models are on and exposing according topics and service handles, but it seems like they are whether not really responding, not getting the message or any other possibility that leads to them not reacting on the messages.

Another keyword that could be helpful here, is that I’m trying to activate the muscles, such that the underlying skeleton is moving accordingly.

I already tried to add some printouts to the code of the muscle interface (ros_muscle_interface.cpp), but that was when/how I realized that the according callbacks aren’t executed.

If you need any further information, please let me know. I’d be thankful for any help :pray: .



Dear Kevin,

Since the tutorial itself is not working, maybe there is a problem with the opensim installation itself. One way to check would be to modify the gzserver script located in $HOME/.opt/bbp/nrp-services/gzserver and modify the corresponing lines that I am pasing by adding the option --verbose like this

              --pause --verbose \
              -s $HBP/GazeboRosPackages/devel/lib/libgazebo_ros_api_plugin.$
              -s $HBP/GazeboRosPackages/devel/lib/libgazebo_ros_paths_plugi$
              -s $HBP/GazeboRosPackages/devel/lib/libgazebo_ros_recording_p$
              -s $HBP/GazeboRosPackages/devel/lib/libgazebo_ros_playback_pl$

Then observe the logs of the console where you do the cle-start and see if there is an error coming from gazebo (some library missing or something like this). If there is no error there we can continue to investigage further.

Best regards,


Hey Manos,

sounds like I should clarify a bit more what of and how I’m using the NRP. I’m not starting the NRP itself, I’m “just” using parts of your source code.

Like my typical workflow is sourcing the “nrp_variables” and “nrp_aliases” and using the “GazeboRosPackage” folder as my catkin_ws. catkin_make and sourcing setup.bash from there and then going for starting gazebo via

gazebo -e opensim 

to use OpenSim as the physic engine. Then I “insert” the models into space and am able to see them and see the according rostopics and services on the ros network.

So my question is especially about how can I use the “cmd_activation” topics and the “set_activation” services properly?
Because right now I tried some stuff out, but there is neither a change in the simulation nor in the “muscle_states” topic.

Simulate robot therapy on spasticity upper limb

I need to add a thank you.

I found the file and the lines you were talking about, I replaced it by the following

               --pause --verbose -e opensim \
               -s $HBP/GazeboRosPackages/devel/lib/ \
               -s $HBP/GazeboRosPackages/devel/lib/ \
               -s $HBP/GazeboRosPackages/devel/lib/ \
               -s $HBP/GazeboRosPackages/devel/lib/ &

and started the server and the client separately, and this led the muscles to actually react to the topic values and the service calls.

Thank you a lot :pray:



Where I can find that tutorial (“opensim_knee_jerkt_tutorial”)?



Hi Oscar,

You can find the tutorial here and you can run it either by accessing the online platform here (requires an account with the Human Brain Project), or if you already have the NRP on your machine, by going to the front page of the NRP (usually localhost:9000/#/esv-private) , then on the templates tab and search for the experiment called Opensim Muscle Tutorial - Knee Jerk Experiment . If you have trouble finding it let us know.



Hi Kevin,

I was wondering if I could ask you some questions, regarding a similiar project I am running where I only need to use the muscle_interface plugin in gazebo running on ROS.

Best regards,