What is this error in Gazebo Co-Simulator?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Cornelius
el 24 de Dic. de 2020
Comentada: Cornelius
el 4 de Feb. de 2021
When I request to read a customized topic I get this error.
MATLAB System block 'Gazebo_Interface/Gazebo Subscribe/SourceBlock' error occurred when invoking 'resetImpl' method of 'robotics.slgazebo.internal.GazeboSubscribeBlk'. The error was thrown from '
'C:\Polyspace\toolbox\robotics\robotsimulink\robotslgazebo\+robotics\+slgazebo\+internal\GazeboSubscribeBlk.m' at line 60'.
Caused by:
Failed to subscribe to topic "/gazebo/default/state". The topic must be published by Gazebo simulator.
4 comentarios
Gaurav Bhosale
el 2 de Feb. de 2021
Editada: Gaurav Bhosale
el 2 de Feb. de 2021
The error message shows "/gazebo/default/state" topic is not publish while the published topic is "gazebo/default/cessna_c172/state". Is anything is missing?
Also, how you are publishing message on "gazebo/default/cessna_c172/state" topic from Gazebo ? Do you have plugin?
Also, are you using shipped VM from here https://www.mathworks.com/support/product/robotics/ros2-vm-installation-instructions-v3.html ?
If yes, then I will recommend you to re-intsall plugin by calling packageGazeboPlugin
You can check following example for latest plugin installation
https://www.mathworks.com/help/robotics/ug/perform-co-simulation-between-simulink-and-gazebo.html
Respuesta aceptada
Gaurav Bhosale
el 4 de Feb. de 2021
Hi Fabricio,
I am able to replicate enviorment you are using and able to subscribe topic without any issue.
To use custom message, you should follow all these steps,
1] In MATLAB
>>gazebogenmsg(pwd,"GazeboMessageList","gazebo.msgs.Cessna")
2] Follow commands at end of gazebogenmsg call
>> addpath('S:\cessna\install')
>>savepath
3] Create Gazebo plugin
>> packageGazeboPlugin('cessnaPlugin.zip','S:\cessna')
4] Copy-paste 'cessnaPlugin.zip' on Ubuntu VM and build
Use following example to build plugin
cd /home/user/src/GazeboPlugin
mkdir build
cd build
cmake ..
make
5] If you have your own cessna.world file then add following line in the cessna.world file
<plugin name="GazeboPlugin" filename="lib/libGazeboCoSimPlugin.so"><portNumber>14581</portNumber></plugin>
Take help of same example ( https://www.mathworks.com/help/robotics/ug/perform-co-simulation-between-simulink-and-gazebo.html)
6] Launch cessna.world file with
cd /home/user/src/GazeboPlugin/export
export SVGA_VGPU10=0
gazebo ../world/cessna.world --verbose
7] Once you launch cessna.world file the you can add Simulink blocks ( pacer and subscribe block) and subscribe 'gazebo/default/cessna_c172/state' topic.
Más respuestas (0)
Ver también
Categorías
Más información sobre Gazebo Co-Simulation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!