includeROS.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // $Id$
00004 //
00005 // Copyright 2008, 2009, 2010, 2011, 2012  Antonio Franchi and Paolo Stegagno    
00006 //
00007 // This file is part of MIP.
00008 //
00009 // MIP is free software: you can redistribute it and/or modify
00010 // it under the terms of the GNU General Public License as published by
00011 // the Free Software Foundation, either version 3 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // MIP is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with MIP. If not, see <http://www.gnu.org/licenses/>.
00021 //
00022 // Contact info: antonio.franchi@tuebingen.mpg.de stegagno@diag.uniroma1.it
00023 //
00024 // ----------------------------------------------------------------------------
00025 
00026 #ifndef __INCLUDE_ROS_
00027  #define __INCLUDE_ROS_
00028 
00029  #ifdef ROS_ELECTRIC
00030   #include "ros/ros.h"
00031   #include "std_msgs/String.h"
00032   #include <ros/callback_queue.h>
00033   
00034   #include <gazebo/Joint.hh>
00035   #include <gazebo/Simulator.hh>
00036   #include <SimTime.h>
00037   #include <ros/ros.h>
00038   #include <std_msgs/String.h>
00039   #include <sensor_msgs/Image.h>
00040   #include <sensor_msgs/CameraInfo.h>
00041   #include <sensor_msgs/LaserScan.h>
00042   #include <sensor_msgs/Imu.h>
00043   #include <geometry_msgs/Vector3Stamped.h>
00044   #include <nav_msgs/Odometry.h>
00045   #include <tf/tf.h>
00046   
00047   #define GAZEBO_PHYSICS_NAMESPACE gazebo
00048   #define GAZEBO_COMMON_NAMESPACE gazebo
00049   #define GAZEBO_JOINT_PTR gazebo::Joint*
00050   #define ROS_QUATERNION tf::btQuaternion
00051   #define ROS_MATRIX33 btMatrix3x3
00052   
00053   static GAZEBO_COMMON_NAMESPACE::Time GAZEBO_GET_SIM_TIME(){
00054    return gazebo::Simulator::Instance()->GetSimTime();
00055   }
00056   
00057  //  #define GAZEBO_GET_SIM_TIME(TIMENAME)\
00058  //  ##TIMENAME = gazebo::Simulator::Instance()->GetSimTime();
00059  #endif
00060  #ifdef ROS_FUERTE
00061   #include "ros/ros.h"
00062   #include "std_msgs/String.h"
00063   #include "std_msgs/Int32.h"
00064   #include <physics/Joint.hh>
00065   #include <physics/World.hh>
00066   #include <physics/State.hh>
00067   #include <physics/Physics.hh>
00068   #include <sensor_msgs/Image.h>
00069   #include <sensor_msgs/CameraInfo.h>
00070   #include <sensor_msgs/LaserScan.h>
00071   #include <sensor_msgs/Range.h>
00072   #include <sensor_msgs/Imu.h>
00073   #include <nav_msgs/Odometry.h>
00074   #include <tf/tf.h>
00075 //  #include <tf/transform_datatypes.h>
00076   
00077   #define GAZEBO_PHYSICS_NAMESPACE gazebo::physics
00078   #define GAZEBO_COMMON_NAMESPACE gazebo::common
00079   #define GAZEBO_JOINT_PTR gazebo::physics::JointPtr
00080   #define ROS_QUATERNION tf::Quaternion
00081   #define ROS_MATRIX33 tf::Matrix3x3
00082   
00083   static GAZEBO_COMMON_NAMESPACE::Time GAZEBO_GET_SIM_TIME(){
00084     std::string _worldName;
00085 //    gazebo::physics::WorldPtr gazebo_world = gazebo::physics::World::GetSimTime();
00086     gazebo::physics::WorldPtr gazebo_world = gazebo::physics::get_world(_worldName);
00087     return gazebo_world->GetSimTime();
00088   }
00089   
00090  //  #define GAZEBO_GET_SIM_TIME gazebo::Simulator::Instance()->GetSimTime()
00091  #endif
00092  
00093 #endif

Generated on Mon Feb 20 07:01:07 2017 for MIP by  doxygen 1.5.6