Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // World plugin
- using namespace std;
- namespace gazebo
- {
- class WorldC: public WorldPlugin
- {
- public: WorldC() : WorldPlugin()
- {
- //...
- }
- public: void Load(physics::WorldPtr _parent, sdf::ElementPtr /*_sdf*/)
- {
- string sdfString = "";
- sdfString = sdfString +
- "<sdf version ='1.3'>\
- <model name='raybot_model'>\
- <!--- ... -->
- </link>\
- <link name='raybot_sensor1'>\
- <pose>0.01 0 1.03 0 0 0</pose>\
- <!--- ... -->
- <sensor name='laser1' type='ray'>\
- <always_on>true</always_on>\
- <visualize>true</visualize>\
- <ray>\
- <!--...->
- </ray>\
- <update_rate>30</update_rate>\
- </sensor>\
- </link>\
- <plugin name='ModelC'filename='libMOdelC.so'/>\
- </model>\
- </sdf>\
- ";
- cout << sdfString << endl; // sdf-code seems to be correct (the code works when entered manually into a world-file)
- sdf::SDF sphereSDF;
- sphereSDF.SetFromString(sdfString);
- _parent->InsertModelSDF(sphereSDF);
- cout << "sdf done" << endl;
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- // Model plugin
- using namespace std;
- namespace gazebo
- {
- class ModelC : public ModelPlugin
- {
- public: ModelC (): ModelPlugin()
- {
- cout << "Hello World" << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement