Skip to content

Commit

Permalink
adapted auto gen file, added FOV type to geometry base
Browse files Browse the repository at this point in the history
  • Loading branch information
rehderj committed Jul 14, 2016
1 parent 98d7d17 commit d0d2e8e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
4 changes: 4 additions & 0 deletions aslam_cv/aslam_cameras/src/CameraGeometryBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ boost::shared_ptr<CameraGeometryBase> CameraGeometryBase::create(
rval.reset(
new CameraGeometry<PinholeProjection<EquidistantDistortion>,
GlobalShutter, NoMask>(config));
} else if (type == "FovDistortedPinhole") {
rval.reset(
new CameraGeometry<PinholeProjection<FovDistortion>,
GlobalShutter, NoMask>(config));
} else if (type == "Omni") {
rval.reset(
new CameraGeometry<OmniProjection<NoDistortion>, GlobalShutter, NoMask>(
Expand Down
29 changes: 14 additions & 15 deletions aslam_cv/aslam_cv_serialization/gen_files.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
"""


BOOST_SERIALIZATION_HEADERS="""
// Standard serialization headers
BOOST_SERIALIZATION_HEADERS="""// Standard serialization headers
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
Expand All @@ -61,14 +59,14 @@
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} >::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);
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
Expand All @@ -77,6 +75,7 @@
cameras = ["PinholeCameraGeometry",
"DistortedPinholeCameraGeometry",
"EquidistantDistortedPinholeCameraGeometry",
"FovDistortedPinholeCameraGeometry",
"OmniCameraGeometry",
"DistortedOmniCameraGeometry",
"EquidistantDistortedOmniCameraGeometry",
Expand Down Expand Up @@ -107,7 +106,7 @@
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( 'BOOST_CLASS_EXPORT_KEY(aslam::cameras::%s);\n' % cam )
outf.write( '\n\n' )

# write the individual camera class files
Expand All @@ -118,7 +117,7 @@
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)
outf.write('BOOST_CLASS_EXPORT_IMPLEMENT(aslam::cameras::%s);\n\n' % cam)

# write the CMake File
with open('autogen_cameras.cmake','w') as outf:
Expand All @@ -133,7 +132,7 @@
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( 'BOOST_CLASS_EXPORT_KEY(aslam::Frame<aslam::cameras::%s >);\n' % cam )
outf.write( '\n\n' )
#outf.write( 'inline void exportFrameBase()\n' )
#outf.write( '{\n' )
Expand All @@ -153,13 +152,13 @@
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('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"
outf.write('#include <aslam/LinkCvSerialization.hpp>\n')

# write the CMake File
with open('autogen_frames.cmake','w') as outf:
Expand Down

0 comments on commit d0d2e8e

Please sign in to comment.