Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ if(${cv_bridge_VERSION} GREATER "3.3.0")
add_definitions(-DUSE_CV_BRIDGE_HPP)
endif()

if(${image_transport_VERSION} VERSION_GREATER_EQUAL "6.3.0")
add_definitions(-DIMAGE_TRANSPORT_USE_QOS)
endif()

#
# --------- library
#
Expand Down
7 changes: 4 additions & 3 deletions include/gtsam_distortion/Cal3DS3.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class Cal3DS3
* @return point in (distorted) image coordinates
*/
gtsam::Point2 uncalibrate(
const gtsam::Point2 & p, gtsam::OptionalJacobian<2, 12> Dcal = boost::none,
gtsam::OptionalJacobian<2, 2> Dp = boost::none) const;
const gtsam::Point2 & p, gtsam::OptionalJacobian<2, 12> Dcal = {},
gtsam::OptionalJacobian<2, 2> Dp = {}) const;

/// Convert (distorted) image coordinates uv to intrinsic coordinates xy
gtsam::Point2 calibrate(
Expand Down Expand Up @@ -180,6 +180,7 @@ class Cal3DS3
/// @name Advanced Interface
/// @{

#if 0
/** Serialization function */
friend class boost::serialization::access;
template <class Archive>
Expand All @@ -198,7 +199,7 @@ class Cal3DS3
ar & BOOST_SERIALIZATION_NVP(k_[4]);
ar & BOOST_SERIALIZATION_NVP(k_[5]);
}

#endif
/// @}
};
// This is really ugly, injecting stuff into gtsam's namespace!
Expand Down
7 changes: 4 additions & 3 deletions include/gtsam_distortion/Cal3FS2.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ class Cal3FS2
* @return point in (distorted) image coordinates
*/
gtsam::Point2 uncalibrate(
const gtsam::Point2 & p, gtsam::OptionalJacobian<2, 8> Dcal = boost::none,
gtsam::OptionalJacobian<2, 2> Dp = boost::none) const;
const gtsam::Point2 & p, gtsam::OptionalJacobian<2, 8> Dcal = {},
gtsam::OptionalJacobian<2, 2> Dp = {}) const;

/// Convert (distorted) image coordinates uv to intrinsic coordinates xy
gtsam::Point2 calibrate(
Expand Down Expand Up @@ -175,6 +175,7 @@ class Cal3FS2
/// @{

/** Serialization function */
#if 0
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive & ar, const unsigned int /*version*/)
Expand All @@ -188,7 +189,7 @@ class Cal3FS2
ar & BOOST_SERIALIZATION_NVP(k3_);
ar & BOOST_SERIALIZATION_NVP(k4_);
}

#endif
/// @}
};
// This is really ugly, injecting stuff into gtsam's namespace!
Expand Down
4 changes: 2 additions & 2 deletions include/tagslam/cal3ds2u.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class Cal3DS2U : public gtsam::Cal3DS2
explicit Cal3DS2U(const gtsam::Cal3DS2 & cal) : Cal3DS2(cal) {}

gtsam::Point2 uncalibrate(
const gtsam::Point2 & p, gtsam::OptionalJacobian<2, 9> Dcal = boost::none,
gtsam::OptionalJacobian<2, 2> Dp = boost::none) const
const gtsam::Point2 & p, gtsam::OptionalJacobian<2, 9> Dcal = {},
gtsam::OptionalJacobian<2, 2> Dp = {}) const
{
return (gtsam::Cal3DS2_Base::uncalibrate(p, Dcal, Dp));
}
Expand Down
7 changes: 6 additions & 1 deletion include/tagslam/sync_and_detect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ class Subscriber<SyncT, Image>
std::bind(
&Subscriber<SyncT, Image>::callback, this, std::placeholders::_1),
node->get_parameter_or<std::string>(param_name, "raw"),
qos.get_rmw_qos_profile()));
#ifdef IMAGE_TRANSPORT_USE_QOS
qos
#else
qos.get_rmw_qos_profile()
#endif
));
}
void callback(const TConstSharedPtr & msg) { sync_->process(topic_, msg); }

Expand Down
5 changes: 4 additions & 1 deletion include/tagslam/tagslam.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
#ifndef TAGSLAM__TAGSLAM_HPP_
#define TAGSLAM__TAGSLAM_HPP_

#if __has_include(<tf2_ros/transform_broadcaster.hpp>)
#include <tf2_ros/transform_broadcaster.hpp>
#else
#include <tf2_ros/transform_broadcaster.h>

#endif
#include <apriltag_msgs/msg/april_tag_detection.hpp>
#include <apriltag_msgs/msg/april_tag_detection_array.hpp>
#include <flex_sync/approximate_sync.hpp>
Expand Down
6 changes: 2 additions & 4 deletions src/gtsam_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ std::shared_ptr<Cal3FS2> GTSAMOptimizer::getEquiModel(

static double distance(
const gtsam::Point3 & p1, const gtsam::Point3 & p2,
gtsam::OptionalJacobian<1, 3> H1 = boost::none,
gtsam::OptionalJacobian<1, 3> H2 = boost::none)
gtsam::OptionalJacobian<1, 3> H1 = {}, gtsam::OptionalJacobian<1, 3> H2 = {})
{
const gtsam::Point3 d = p1 - p2;
double r = sqrt(d.x() * d.x() + d.y() * d.y() + d.z() * d.z());
Expand All @@ -150,8 +149,7 @@ static double distance(

static double proj(
const gtsam::Point3 & p, const gtsam::Point3 & n,
gtsam::OptionalJacobian<1, 3> Hp = boost::none,
gtsam::OptionalJacobian<1, 3> Hn = boost::none)
gtsam::OptionalJacobian<1, 3> Hp = {}, gtsam::OptionalJacobian<1, 3> Hn = {})
{
double r = p.x() * n.x() + p.y() * n.y() + p.z() * n.z();
if (Hp) *Hp << n.x(), n.y(), n.z(); // jacobian w.r.t to p
Expand Down
4 changes: 2 additions & 2 deletions src/tagslam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <cv_bridge/cv_bridge.h>
#endif

#include <tf2/LinearMath/Transform.h>
#include <tf2/transform_datatypes.h>
#include <yaml-cpp/yaml.h>

#include <cmath>
Expand All @@ -46,6 +44,8 @@
#include <tagslam/tagslam.hpp>
#include <tagslam/yaml.hpp>
#include <tagslam/yaml_utils.hpp>
#include <tf2/LinearMath/Transform.hpp>
#include <tf2/transform_datatypes.hpp>
#include <unordered_set>

const int QSZ = 1000;
Expand Down