Matlab Ros Gazebo Add force to Ball

2 ビュー (過去 30 日間)
Philipp Kugler
Philipp Kugler 2020 年 11 月 19 日
回答済み: Cam Salzberger 2020 年 11 月 23 日
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 https://de.mathworks.com/support/product/robotics/ros2-vm-installation-instructions-v3.html site.
So now i spawned several models to the gazebo (following the https://de.mathworks.com/help/ros/ug/add-build-remove-objects-in-gazebo.html 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 (https://de.mathworks.com/matlabcentral/answers/423993-spawnmodel-error-in-robotics-system-toolbox) 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.
Regards,
Philipp

回答 (1 件)

Cam Salzberger
Cam Salzberger 2020 年 11 月 23 日
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.
-Cam

カテゴリ

Help Center および File ExchangeNetwork Connection and Exploration についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by