Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <gazebo-2.0/gazebo/math/Pose.hh>
- #include <boost/bind.hpp>
- #include <gazebo/gazebo.hh>
- #include <gazebo/physics/physics.hh>
- #include <gazebo/common/common.hh>
- #include <gazebo/math/Matrix4.hh>
- #include <stdio.h>
- #include <cmath>
- #include <stdlib.h>
- #include <time.h>
- #include <iostream>
- #include <ostream>
- #include "gazebo/transport/transport.hh"
- #include "gazebo/msgs/msgs.hh"
- #include "gazebo/msgs/vector3d.pb.h"
- #include <gazebo/rendering/rendering.hh>
- #include <gazebo/gui/gui.hh>
- using namespace std;
- using namespace gazebo;
- class SystemGUI : public SystemPlugin
- {
- public: void Load(int /*_argc*/, char ** /*_argv*/)
- {
- cout<<"Load()!"<<sizeof(text)<<endl;
- this->connections.push_back(event::Events::ConnectPreRender(boost::bind(&SystemGUI::Update, this)));
- text.SetText("XXX");
- text.SetShowOnTop(true);
- text.SetColor(common::Color::Red);
- text.setDebugDisplayEnabled(true);
- text.SetCharHeight(100);
- }
- private: void Update()
- {
- if (!this->userCam)
- {
- this->userCam = gui::get_active_camera();
- userCam->SetAspectRatio (3);
- }
- scene = rendering::get_scene();
- if (!scene || !scene->GetInitialized())
- return;
- }
- private : rendering::MovableText text;
- /// Pointer the user camera.
- private: rendering::UserCameraPtr userCam;
- rendering::ScenePtr scene;
- /// All the event connections.
- private: std::vector<event::ConnectionPtr> connections;
- };
- GZ_REGISTER_SYSTEM_PLUGIN(SystemGUI);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement