Matlab Ros Gazebo Add force to Ball

3 views (last 30 days)
Philipp Kugler
Philipp Kugler on 19 Nov 2020
Answered: Cam Salzberger on 23 Nov 2020
Hello together,
I'm a beginner with Matlab Gazebo tool, so I'm working with a virtual Machine using the VMWare Workstation with an Gazebo world.
In these World there is the turtle bot, so i was folliwing the tutorial of the site.
So now i spawned several models to the gazebo (following the tutorial) world but there are some errors with the ExampleHelperGazeboSpawnedModel function.
If I want to get the state of the model to add some forc to the ball, then i get the error:
Error using ExampleHelperGazeboSpawnedModel/getState (line 104)
Error during service call, cannot get the state of the model
Error in ExampleHelperGazeboSpawnedModel (line 70)
[obj.Position, obj.Orientation, obj.Velocity] = getState(obj);
I was checking the ExampleHelperGazeboSpawnedModel()-function. There at Line 70, the function calls the
msg = call(obj.GetStateClient,serviceMsg);
then the error occorus.
I'm working with Matlab2020b, so the current verison. I found some workaround ( to solve these problem, to change some java files on my host PC, but these java-file witch i did not found on my pc.
So does anybody know some other idea to solve these problem?
Thank you very much in advance.

Answers (1)

Cam Salzberger
Cam Salzberger on 23 Nov 2020
Hello Philipp,
There is an issue with the specific service definition that is used in that call command. We are working on a resolution for this issue.
A somewhat time-consuming workaround in the meantime would be to regenerate the gazebo_msgs package (using the Melodic version of the package) using rosgenmsg. I believe this should ensure that the service is able to communicate, though I have not tested this personally.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!