Proper opensim ros muscle interface usage


#1

Hi,

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: .

Regards,
Kevin


#2

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

 $VGLRUN $exec $GZSERVER_ARGS \
              --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$
retval=$?

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,
Manos


#3

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.


#4

I need to add a thank you.

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

$VGLRUN $exec $GZSERVER_ARGS \
               --pause --verbose -e opensim \
               -s $HBP/GazeboRosPackages/devel/lib/libgazebo_ros_api_plugin.so \
               -s $HBP/GazeboRosPackages/devel/lib/libgazebo_ros_paths_plugin.so \
               -s $HBP/GazeboRosPackages/devel/lib/libgazebo_ros_recording_plugin.so \
               -s $HBP/GazeboRosPackages/devel/lib/libgazebo_ros_playback_plugin.so &
retval=$?

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: