Skip to content

Commit

Permalink
pull in changes from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Schneider committed Jun 18, 2014
1 parent 37ad6a8 commit cc24612
Show file tree
Hide file tree
Showing 70 changed files with 2,282 additions and 0 deletions.
1 change: 1 addition & 0 deletions aslam_cv/aslam_cv_serialization/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test.ba
29 changes: 29 additions & 0 deletions aslam_cv/aslam_cv_serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 2.8.3)
project(aslam_cv_serialization)

find_package(catkin_simple REQUIRED)
catkin_simple()

#common commands for building c++ executables and libraries
INCLUDE(autogen_cameras.cmake)
#INCLUDE(autogen_frames.cmake)

cs_add_library(${PROJECT_NAME}
# ${AUTOGEN_FRAME_CPP_FILES}
${AUTOGEN_CAMERA_CPP_FILES}
src/FrameBaseSerialization.cpp
)

find_package(Boost REQUIRED COMPONENTS serialization)
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})

# Avoid clash with tr1::tuple: https://code.google.com/p/googletest/source/browse/trunk/README?r=589#257
#add_definitions(-DGTEST_USE_OWN_TR1_TUPLE=0)
#catkin_add_gtest(${PROJECT_NAME}_tests
# test/test_main.cpp
# test/testMultiFrame.cpp
#)
#target_link_libraries(${PROJECT_NAME}_tests ${PROJECT_NAME})

cs_install()
cs_export()
1 change: 1 addition & 0 deletions aslam_cv/aslam_cv_serialization/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(shell rospack find mk)/cmake.mk
31 changes: 31 additions & 0 deletions aslam_cv/aslam_cv_serialization/autogen_cameras.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py
SET( AUTOGEN_CAMERA_CPP_FILES
src/autogen/Camera-PinholeCameraGeometry.cpp
src/autogen/Camera-DistortedPinholeCameraGeometry.cpp
src/autogen/Camera-EquidistantDistortedPinholeCameraGeometry.cpp
src/autogen/Camera-OmniCameraGeometry.cpp
src/autogen/Camera-DistortedOmniCameraGeometry.cpp
src/autogen/Camera-EquidistantDistortedOmniCameraGeometry.cpp
# src/autogen/Camera-PinholeRsCameraGeometry.cpp
# src/autogen/Camera-DistortedPinholeRsCameraGeometry.cpp
# src/autogen/Camera-EquidistantDistortedPinholeRsCameraGeometry.cpp
# src/autogen/Camera-OmniRsCameraGeometry.cpp
# src/autogen/Camera-DistortedOmniRsCameraGeometry.cpp
# src/autogen/Camera-EquidistantDistortedOmniRsCameraGeometry.cpp
# src/autogen/Camera-MaskedPinholeCameraGeometry.cpp
# src/autogen/Camera-MaskedDistortedPinholeCameraGeometry.cpp
# src/autogen/Camera-MaskedEquidistantDistortedPinholeCameraGeometry.cpp
# src/autogen/Camera-MaskedOmniCameraGeometry.cpp
# src/autogen/Camera-MaskedDistortedOmniCameraGeometry.cpp
# src/autogen/Camera-MaskedEquidistantDistortedOmniCameraGeometry.cpp
# src/autogen/Camera-MaskedPinholeRsCameraGeometry.cpp
# src/autogen/Camera-MaskedDistortedPinholeRsCameraGeometry.cpp
# src/autogen/Camera-MaskedEquidistantDistortedPinholeRsCameraGeometry.cpp
# src/autogen/Camera-MaskedOmniRsCameraGeometry.cpp
# src/autogen/Camera-MaskedDistortedOmniRsCameraGeometry.cpp
# src/autogen/Camera-MaskedEquidistantDistortedOmniRsCameraGeometry.cpp
# src/autogen/Camera-DepthCameraGeometry.cpp
# src/autogen/Camera-DistortedDepthCameraGeometry.cpp
# src/autogen/Camera-EquidistantDistortedDepthCameraGeometry.cpp
)

31 changes: 31 additions & 0 deletions aslam_cv/aslam_cv_serialization/autogen_frames.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py
SET( AUTOGEN_FRAME_CPP_FILES
src/autogen/Frame-PinholeCameraGeometry.cpp
src/autogen/Frame-DistortedPinholeCameraGeometry.cpp
src/autogen/Frame-EquidistantDistortedPinholeCameraGeometry.cpp
src/autogen/Frame-OmniCameraGeometry.cpp
src/autogen/Frame-DistortedOmniCameraGeometry.cpp
src/autogen/Frame-EquidistantDistortedOmniCameraGeometry.cpp
src/autogen/Frame-PinholeRsCameraGeometry.cpp
src/autogen/Frame-DistortedPinholeRsCameraGeometry.cpp
src/autogen/Frame-EquidistantDistortedPinholeRsCameraGeometry.cpp
src/autogen/Frame-OmniRsCameraGeometry.cpp
src/autogen/Frame-DistortedOmniRsCameraGeometry.cpp
src/autogen/Frame-EquidistantDistortedOmniRsCameraGeometry.cpp
src/autogen/Frame-MaskedPinholeCameraGeometry.cpp
src/autogen/Frame-MaskedDistortedPinholeCameraGeometry.cpp
src/autogen/Frame-MaskedEquidistantDistortedPinholeCameraGeometry.cpp
src/autogen/Frame-MaskedOmniCameraGeometry.cpp
src/autogen/Frame-MaskedDistortedOmniCameraGeometry.cpp
src/autogen/Frame-MaskedEquidistantDistortedOmniCameraGeometry.cpp
src/autogen/Frame-MaskedPinholeRsCameraGeometry.cpp
src/autogen/Frame-MaskedDistortedPinholeRsCameraGeometry.cpp
src/autogen/Frame-MaskedEquidistantDistortedPinholeRsCameraGeometry.cpp
src/autogen/Frame-MaskedOmniRsCameraGeometry.cpp
src/autogen/Frame-MaskedDistortedOmniRsCameraGeometry.cpp
src/autogen/Frame-MaskedEquidistantDistortedOmniRsCameraGeometry.cpp
src/autogen/Frame-DepthCameraGeometry.cpp
src/autogen/Frame-DistortedDepthCameraGeometry.cpp
src/autogen/Frame-EquidistantDistortedDepthCameraGeometry.cpp
)

170 changes: 170 additions & 0 deletions aslam_cv/aslam_cv_serialization/gen_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
#!/usr/bin/env python

CAMERA_FILE_HEADER="""
/**
* @file CameraGeometryBaseSerialization.hpp
* @author Paul Furgale <[email protected]>
* @date Tue Apr 16 09:43:33 2013
*
* @brief This file is needed to enable serialization using CameraGeometryBase pointers
*
* THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py
*
*/
#include <boost/serialization/export.hpp>
#include <aslam/cameras.hpp>
BOOST_CLASS_EXPORT_KEY( aslam::cameras::CameraGeometryBase );
"""

FRAME_FILE_HEADER="""
#ifndef ASLAM_FRAME_BASE_SERIALIZATION_HPP
#define ASLAM_FRAME_BASE_SERIALIZATION_HPP
/**
* @file FrameBaseSerialization.hpp
* @author Paul Furgale <[email protected]>
* @date Tue Apr 16 09:43:33 2013
*
* @brief This file is needed to enable serialization using FrameBase pointers
*
* THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py
*
*/
#include <boost/serialization/export.hpp>
#include <aslam/cameras.hpp>
#include <aslam/Frame.hpp>
#include \"LinkCvSerialization.hpp\"
"""


BOOST_SERIALIZATION_HEADERS="""
// Standard serialization headers
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>
// These ones are in sm_boost
#include <boost/portable_binary_iarchive.hpp>
#include <boost/portable_binary_oarchive.hpp>
"""

FRAME_EXPORT="""
namespace aslam {{
template void Frame< aslam::cameras::{0} >::save<>(boost::archive::text_oarchive & ar, const unsigned int version) const;
template void Frame< aslam::cameras::{0} >::load<>(boost::archive::text_iarchive & ar, const unsigned int version);
template void Frame< aslam::cameras::{0} >::save<>(boost::archive::xml_oarchive & ar, const unsigned int version) const;
template void Frame< aslam::cameras::{0} >::load<>(boost::archive::xml_iarchive & ar, const unsigned int version);
template void Frame< aslam::cameras::{0} >::save<>(boost::archive::binary_oarchive & ar, const unsigned int version) const;
template void Frame< aslam::cameras::{0} >::load<>(boost::archive::binary_iarchive & ar, const unsigned int version);
template void Frame< aslam::cameras::{0} >::save<>(boost::archive::portable_binary_oarchive & ar, const unsigned int version) const;
template void Frame< aslam::cameras::{0} >::load<>(boost::archive::portable_binary_iarchive & ar, const unsigned int version);
}} // namespace aslam
"""

cameras = ["PinholeCameraGeometry",
"DistortedPinholeCameraGeometry",
"EquidistantDistortedPinholeCameraGeometry",
"OmniCameraGeometry",
"DistortedOmniCameraGeometry",
"EquidistantDistortedOmniCameraGeometry",
"PinholeRsCameraGeometry",
"DistortedPinholeRsCameraGeometry",
"EquidistantDistortedPinholeRsCameraGeometry",
"OmniRsCameraGeometry",
"DistortedOmniRsCameraGeometry",
"EquidistantDistortedOmniRsCameraGeometry",
"MaskedPinholeCameraGeometry",
"MaskedDistortedPinholeCameraGeometry",
"MaskedEquidistantDistortedPinholeCameraGeometry",
"MaskedOmniCameraGeometry",
"MaskedDistortedOmniCameraGeometry",
"MaskedEquidistantDistortedOmniCameraGeometry",
"MaskedPinholeRsCameraGeometry",
"MaskedDistortedPinholeRsCameraGeometry",
"MaskedEquidistantDistortedPinholeRsCameraGeometry",
"MaskedOmniRsCameraGeometry",
"MaskedDistortedOmniRsCameraGeometry",
"MaskedEquidistantDistortedOmniRsCameraGeometry",
"DepthCameraGeometry",
"DistortedDepthCameraGeometry",
"EquidistantDistortedDepthCameraGeometry"]


# write the camera header
with open('include/aslam/cameras/CameraBaseSerialization.hpp','w') as outf:
outf.write(CAMERA_FILE_HEADER)
for cam in cameras:
outf.write( 'BOOST_CLASS_EXPORT_KEY( aslam::cameras::%s );\n' % cam )
outf.write( '\n\n' )

# write the individual camera class files
cam_fnames=[]
for cam in cameras:
fname = 'src/autogen/Camera-%s.cpp' % (cam)
cam_fnames.append(fname)
with open(fname,'w') as outf:
outf.write('#include <aslam/cameras/CameraBaseSerialization.hpp>\n\n')
outf.write(BOOST_SERIALIZATION_HEADERS)
outf.write('BOOST_CLASS_EXPORT_IMPLEMENT( aslam::cameras::%s );\n\n' % cam)

# write the CMake File
with open('autogen_cameras.cmake','w') as outf:
outf.write("# THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py\n")
outf.write("SET( AUTOGEN_CAMERA_CPP_FILES\n")
for cam in cam_fnames:
outf.write('\t%s\n' % cam)
outf.write(')\n\n')


# write the frame header
with open('include/aslam/FrameBaseSerialization.hpp','w') as outf:
outf.write(FRAME_FILE_HEADER)
for cam in cameras:
outf.write( 'BOOST_CLASS_EXPORT_KEY( aslam::Frame<aslam::cameras::%s> );\n' % cam )
outf.write( '\n\n' )
#outf.write( 'inline void exportFrameBase()\n' )
#outf.write( '{\n' )
#for cam in cameras:
# frame = "aslam::Frame< aslam::cameras::{0} >".format(cam)
# outf.write( '\tboost::serialization::void_cast_register< {0}, aslam::FrameBase>(static_cast<{0} *>(NULL), static_cast< aslam::FrameBase * >(NULL) );\n'.format(frame) )
#outf.write( '}\n' )
outf.write( '#endif // ASLAM_FRAME_BASE_SERIALIZATION_HPP\n\n' )
# write the individual frame class files
cam_fnames=[]
for cam in cameras:
fname = 'src/autogen/Frame-%s.cpp' % (cam)
cam_fnames.append(fname)
with open(fname,'w') as outf:
outf.write("// THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py\n")
outf.write('#include <aslam/cameras.hpp>\n')
outf.write('#include <aslam/Frame.hpp>\n')
outf.write('#include <aslam/FrameBaseSerialization.hpp>\n\n')
outf.write(BOOST_SERIALIZATION_HEADERS)
outf.write('BOOST_CLASS_EXPORT_IMPLEMENT( aslam::Frame<aslam::cameras::%s> );\n\n' % cam)
outf.write(FRAME_EXPORT.format( cam ) )
outf.write("\n\n")

# write the "linkCvSerialization" cpp file
with open('src/LinkCvSerialization.cpp', 'w') as outf:
outf.write('#include <aslam/LinkCvSerialization.hpp>\n"

# write the CMake File
with open('autogen_frames.cmake','w') as outf:
outf.write("# THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py\n")
outf.write("SET( AUTOGEN_FRAME_CPP_FILES\n")
for cam in cam_fnames:
outf.write('\t%s\n' % cam)
outf.write(')\n\n')
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#ifndef ASLAM_FRAME_BASE_SERIALIZATION_HPP
#define ASLAM_FRAME_BASE_SERIALIZATION_HPP

/**
* @file FrameBaseSerialization.hpp
* @author Paul Furgale <[email protected]>
* @date Tue Apr 16 09:43:33 2013
*
* @brief This file is needed to enable serialization using FrameBase pointers
*
* THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py
*
*/

#include <boost/serialization/export.hpp>
#include <aslam/cameras.hpp>
#include <aslam/Frame.hpp>
#include "LinkCvSerialization.hpp"

BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::PinholeCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::DistortedPinholeCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::EquidistantDistortedPinholeCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::OmniCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::DistortedOmniCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::EquidistantDistortedOmniCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::PinholeRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::DistortedPinholeRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::EquidistantDistortedPinholeRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::OmniRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::DistortedOmniRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::EquidistantDistortedOmniRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::MaskedPinholeCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedDistortedPinholeCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedEquidistantDistortedPinholeCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::MaskedOmniCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedDistortedOmniCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedEquidistantDistortedOmniCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedPinholeRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedDistortedPinholeRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedEquidistantDistortedPinholeRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::MaskedOmniRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedDistortedOmniRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::MaskedEquidistantDistortedOmniRsCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<aslam::cameras::DepthCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::DistortedDepthCameraGeometry>);
BOOST_CLASS_EXPORT_KEY (aslam::Frame<
aslam::cameras::EquidistantDistortedDepthCameraGeometry>);

#endif // ASLAM_FRAME_BASE_SERIALIZATION_HPP

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef ASLAM_LINK_CV_SERIALIZATION_HPP
#define ASLAM_LINK_CV_SERIALIZATION_HPP

#include<aslam/FrameBaseSerialization.hpp>
#include <aslam/cameras/CameraBaseSerialization.hpp>

namespace aslam {

int linkCvSerialization();

} // namespace aslam

#endif /* ASLAM_LINK_CV_SERIALIZATION_HPP */
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#ifndef ASLAM_CV_SERIALIZATION_CAMERA_BASE_SERIALIZATION
#define ASLAM_CV_SERIALIZATION_CAMERA_BASE_SERIALIZATION

/**
* @file CameraGeometryBaseSerialization.hpp
* @author Paul Furgale <[email protected]>
* @date Tue Apr 16 09:43:33 2013
*
* @brief This file is needed to enable serialization using CameraGeometryBase pointers
*
* THIS FILE HAS BEEN AUTOGENERATED BY gen_files.py
*
*/

#include <boost/serialization/export.hpp>
#include <aslam/cameras.hpp>

BOOST_CLASS_EXPORT_KEY (aslam::cameras::CameraGeometryBase);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::PinholeCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::DistortedPinholeCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::EquidistantDistortedPinholeCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::OmniCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::DistortedOmniCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::EquidistantDistortedOmniCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::PinholeRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::DistortedPinholeRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::EquidistantDistortedPinholeRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::OmniRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::DistortedOmniRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::EquidistantDistortedOmniRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedPinholeCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedDistortedPinholeCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedEquidistantDistortedPinholeCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedOmniCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedDistortedOmniCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedEquidistantDistortedOmniCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedPinholeRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedDistortedPinholeRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedEquidistantDistortedPinholeRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedOmniRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedDistortedOmniRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::MaskedEquidistantDistortedOmniRsCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::DepthCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::DistortedDepthCameraGeometry);
BOOST_CLASS_EXPORT_KEY (aslam::cameras::EquidistantDistortedDepthCameraGeometry);

#endif /* ASLAM_CV_SERIALIZATION_CAMERA_BASE_SERIALIZATION */
Loading

0 comments on commit cc24612

Please sign in to comment.