[Jderobot-admin] jderobot-r870 - trunk/src/components/pluginsGazebo/kinect
ahcorde en jderobot.org
ahcorde en jderobot.org
Vie Mar 1 12:33:55 CET 2013
Author: ahcorde
Date: 2013-03-01 12:32:55 +0100 (Fri, 01 Mar 2013)
New Revision: 870
Modified:
trunk/src/components/pluginsGazebo/kinect/CMakeLists.txt
trunk/src/components/pluginsGazebo/kinect/kinect.world
trunk/src/components/pluginsGazebo/kinect/kinectPlugin.cc
Log:
[ahcorde]
Modified: trunk/src/components/pluginsGazebo/kinect/CMakeLists.txt
===================================================================
--- trunk/src/components/pluginsGazebo/kinect/CMakeLists.txt 2013-03-01 09:36:47 UTC (rev 869)
+++ trunk/src/components/pluginsGazebo/kinect/CMakeLists.txt 2013-03-01 11:32:55 UTC (rev 870)
@@ -1,3 +1,4 @@
+
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
include (FindPkgConfig)
if (PKG_CONFIG_FOUND)
@@ -3,11 +4,31 @@
pkg_check_modules(GAZEBO gazebo)
endif()
+
find_package(PCL 1.2 REQUIRED)
+find_package(OpenCV REQUIRED)
-include_directories( ${GAZEBO_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} /usr/local/include/gearbox/ /usr/local/include/jderobot)
-link_directories( ${GAZEBO_LIBRARY_DIRS} ${PCL_LIBRARY_DIRS} /usr/local/lib/jderobot)
+include_directories(
+ ${GAZEBO_INCLUDE_DIRS}
+ ${PCL_INCLUDE_DIRS}
+ /usr/local/include/gearbox/
+ /usr/local/include/jderobot
+
+ )
+link_directories(
+ ${GAZEBO_LIBRARY_DIRS}
+ ${PCL_LIBRARY_DIRS}
+ )
set( CMAKE_CXX_FLAGS "-lIce -lIceUtil" ) # Opciones para el compilador
add_library(kinectPlugin SHARED kinectPlugin.cc)
-target_link_libraries(kinectPlugin ${GAZEBO_libraries} ${PCL_LIBRARIES} opencv_core opencv_highgui opencv_imgproc ${ZeroCIce_LIBRARIES} jderobotice jderobotutil colorspacesmm JderobotInterfaces)
+
+target_link_libraries(kinectPlugin
+ ${GAZEBO_libraries}
+ ${PCL_LIBRARIES}
+ ${OpenCV_LIBS}
+ /usr/local/lib/jderobot/libJderobotInterfaces.so
+ /usr/local/lib/jderobot/libjderobotice.so
+ /usr/local/lib/jderobot/libjderobotutil.so
+
+)
Modified: trunk/src/components/pluginsGazebo/kinect/kinect.world
===================================================================
--- trunk/src/components/pluginsGazebo/kinect/kinect.world 2013-03-01 09:36:47 UTC (rev 869)
+++ trunk/src/components/pluginsGazebo/kinect/kinect.world 2013-03-01 11:32:55 UTC (rev 870)
@@ -1,9 +1,12 @@
<?xml version ='1.0'?>
<gazebo version ='1.0'>
<world name='default'>
- <include filename='ground_plane.model'/>
- <model name='pioneer2dx' static='0'>
- <pose>10.000000 -15.000000 0.160000 0.000000 -0.000000 0.000000</pose>
+ <include>
+ <uri>model://ground_plane</uri>
+ </include>
+
+ <model name='kinect_model'>
+ <static>true</static>
<link name="kinect">
<inertial>
<mass>0.30</mass>
@@ -37,7 +40,10 @@
</sensor>
</link>
</model>
- <include filename='sun.light'/>
+ <include>
+ <uri>model://sun</uri>
+ </include>
+
</world>
</gazebo>
Modified: trunk/src/components/pluginsGazebo/kinect/kinectPlugin.cc
===================================================================
--- trunk/src/components/pluginsGazebo/kinect/kinectPlugin.cc 2013-03-01 09:36:47 UTC (rev 869)
+++ trunk/src/components/pluginsGazebo/kinect/kinectPlugin.cc 2013-03-01 11:32:55 UTC (rev 870)
@@ -170,7 +170,7 @@
pthread_mutex_lock (&kinect->mutex);
- //cloud->points.resize(_width*_height);
+ cloud->points.resize(_width*_height);
int indicePunto = 0;
pcl::PointXYZRGBA point;
@@ -178,6 +178,7 @@
point.g = 0;
point.b = 0;
+
for(int x = 0 ; x < _width ; x++){
for(int y = 0; y < _height; y++){
int indice = y*_width + x;
@@ -210,6 +211,7 @@
}
}
+
pcl::VoxelGrid<pcl::PointXYZRGBA> sor;
sor.setInputCloud (cloud);
@@ -661,11 +663,11 @@
jderobotice::Context context;
Ice::ObjectPtr object = new KinectI(std::string("KinectGazebo"), context, kinect);
- //Ice::ObjectPtr object2 = new CameraI(std::string("KinectGazebo"), context, kinect);
+ Ice::ObjectPtr object2 = new CameraI(std::string("KinectGazebo"), context, kinect);
//Ice::ObjectPtr object3 = new CameraII(std::string("KinectGazebo"), context, kinect);
adapter->add(object, ic->stringToIdentity("Kinect"));
- //adapter->add(object2, ic->stringToIdentity("KinectRGB"));
+ adapter->add(object2, ic->stringToIdentity("KinectRGB"));
//adapter->add(object3, ic->stringToIdentity("KinectDepth"));
std::cout << " adapter->add(object, ic->stringToIdentity(Kinect)); " << std::endl;
adapter->activate();
More information about the Jderobot-admin
mailing list