├── voxgraph_msgs
├── msg
│ ├── LoopClosure.msg
│ ├── LoopClosureEdgeList.msg
│ ├── LoopClosureEdge.msg
│ └── MapSurface.msg
├── CMakeLists.txt
└── package.xml
├── arche_ssh.rosinstall
├── arche_https.rosinstall
├── voxgraph_ssh.rosinstall
├── voxgraph_https.rosinstall
├── .gitignore
├── voxgraph
├── launch
│ ├── registration_test_bench.launch
│ ├── arche_demo.launch
│ └── voxgraph_mapper.launch
├── include
│ └── voxgraph
│ │ ├── common.h
│ │ ├── tools
│ │ ├── rosbag_helper.h
│ │ ├── tf_helper.h
│ │ ├── visualization
│ │ │ ├── pose_graph_visuals.h
│ │ │ ├── cost_function_visuals.h
│ │ │ ├── loop_closure_visuals.h
│ │ │ └── submap_visuals.h
│ │ ├── io.h
│ │ ├── threading_helper.h
│ │ ├── ros_params.h
│ │ ├── submap_registration_helper.h
│ │ ├── data_servers
│ │ │ ├── projected_map_server.h
│ │ │ ├── loop_closure_edge_server.h
│ │ │ └── submap_server.h
│ │ ├── odometry_simulator
│ │ │ ├── normal_distribution.h
│ │ │ └── odometry_simulator.h
│ │ └── evaluation
│ │ │ └── map_evaluation.h
│ │ ├── frontend
│ │ ├── submap_collection
│ │ │ ├── registration_point.h
│ │ │ ├── bounding_box.h
│ │ │ ├── submap_timeline.h
│ │ │ ├── weighted_sampler.h
│ │ │ ├── weighted_sampler_inl.h
│ │ │ ├── voxgraph_submap_collection.h
│ │ │ └── voxgraph_submap.h
│ │ ├── measurement_processors
│ │ │ ├── gps_processor.h
│ │ │ └── pointcloud_integrator.h
│ │ ├── pose_graph_interface
│ │ │ ├── node_templates.h
│ │ │ ├── measurement_templates.h
│ │ │ └── pose_graph_interface.h
│ │ ├── map_tracker
│ │ │ ├── transformers
│ │ │ │ ├── tf_transformer.h
│ │ │ │ └── odometry_transformer.h
│ │ │ └── map_tracker.h
│ │ ├── frame_names.h
│ │ └── voxgraph_mapper.h
│ │ └── backend
│ │ ├── local_parameterization
│ │ ├── normalize_angle.h
│ │ └── angle_local_parameterization.h
│ │ ├── node
│ │ ├── pose
│ │ │ ├── pose.h
│ │ │ ├── pose_6d.h
│ │ │ └── pose_4d.h
│ │ ├── submap_node.h
│ │ ├── reference_frame_node.h
│ │ ├── node.h
│ │ └── node_collection.h
│ │ ├── constraint
│ │ ├── absolute_pose_constraint.h
│ │ ├── relative_pose_constraint.h
│ │ ├── constraint.h
│ │ ├── constraint_collection.h
│ │ ├── registration_constraint.h
│ │ └── cost_functions
│ │ │ ├── relative_pose_cost_function.h
│ │ │ ├── registration_cost_function.h
│ │ │ └── relative_pose_cost_function_inl.h
│ │ └── pose_graph.h
├── src
│ ├── tools
│ │ ├── rosbag_helper.cpp
│ │ ├── tf_helper.cpp
│ │ ├── visualization
│ │ │ ├── pose_graph_visuals.cpp
│ │ │ ├── loop_closure_visuals.cpp
│ │ │ ├── cost_function_visuals.cpp
│ │ │ └── submap_visuals.cpp
│ │ ├── data_servers
│ │ │ ├── projected_map_server.cpp
│ │ │ └── loop_closure_edge_server.cpp
│ │ ├── submap_registration_helper.cpp
│ │ └── evaluation
│ │ │ └── map_evaluation.cpp
│ ├── voxgraph_mapping_node.cpp
│ ├── odometry_simulator_node.cpp
│ ├── backend
│ │ ├── node
│ │ │ ├── pose
│ │ │ │ ├── pose_6d.cpp
│ │ │ │ └── pose_4d.cpp
│ │ │ ├── node.cpp
│ │ │ └── node_collection.cpp
│ │ └── constraint
│ │ │ ├── constraint_collection.cpp
│ │ │ ├── absolute_pose_constraint.cpp
│ │ │ ├── relative_pose_constraint.cpp
│ │ │ ├── registration_constraint.cpp
│ │ │ └── constraint.cpp
│ └── frontend
│ │ ├── pose_graph_interface
│ │ ├── node_templates.cpp
│ │ └── measurement_templates.cpp
│ │ ├── map_tracker
│ │ ├── transformers
│ │ │ ├── tf_transformer.cpp
│ │ │ └── odometry_transformer.cpp
│ │ └── map_tracker.cpp
│ │ ├── submap_collection
│ │ ├── submap_timeline.cpp
│ │ ├── bounding_box.cpp
│ │ └── voxgraph_submap_collection.cpp
│ │ └── measurement_processors
│ │ └── pointcloud_integrator.cpp
├── package.xml
├── config
│ ├── odometry_simulator.yaml
│ ├── registration_test_bench.yaml
│ ├── voxgraph_mapper.yaml
│ └── voxgraph_mapper.rviz
├── CMakeLists.txt
└── scripts
│ └── jacobians_xyz_yaw.py
├── LICENSE
└── .clang-format
/voxgraph_msgs/msg/LoopClosure.msg:
--------------------------------------------------------------------------------
1 | time from_timestamp
2 | time to_timestamp
3 | geometry_msgs/Transform transform
4 | float64[36] information
--------------------------------------------------------------------------------
/voxgraph_msgs/msg/LoopClosureEdgeList.msg:
--------------------------------------------------------------------------------
1 | # Message header
2 | std_msgs/Header header
3 |
4 | # List of loop closure edges
5 | voxgraph_msgs/LoopClosureEdge[] loop_closure_edges
--------------------------------------------------------------------------------
/arche_ssh.rosinstall:
--------------------------------------------------------------------------------
1 | - git:
2 | local-name: ouster_lidar
3 | uri: git@github.com:ethz-asl/ouster_lidar.git
4 | - git:
5 | local-name: lidar_undistortion
6 | uri: git@github.com:ethz-asl/lidar_undistortion.git
7 |
--------------------------------------------------------------------------------
/arche_https.rosinstall:
--------------------------------------------------------------------------------
1 | - git:
2 | local-name: ouster_lidar
3 | uri: https://github.com/ethz-asl/ouster_lidar.git
4 | - git:
5 | local-name: lidar_undistortion
6 | uri: https://github.com/ethz-asl/lidar_undistortion.git
7 |
--------------------------------------------------------------------------------
/voxgraph_msgs/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(voxgraph_msgs)
3 |
4 | find_package(catkin_simple REQUIRED)
5 | catkin_simple(ALL_DEPS_REQUIRED)
6 |
7 | ##########
8 | # EXPORT #
9 | ##########
10 | cs_install()
11 | cs_export()
12 |
--------------------------------------------------------------------------------
/voxgraph_msgs/msg/LoopClosureEdge.msg:
--------------------------------------------------------------------------------
1 | # Timestamps of both vertices
2 | time timestamp_A
3 | time timestamp_B
4 |
5 | # Relative pose and covariance of the edge
6 | # NOTE: These are expressed as the pose of vertex B in the frame of vertex A
7 | geometry_msgs/PoseWithCovariance T_A_B
--------------------------------------------------------------------------------
/voxgraph_ssh.rosinstall:
--------------------------------------------------------------------------------
1 | - git:
2 | local-name: ceres_catkin
3 | uri: git@github.com:ethz-asl/ceres_catkin.git
4 | - git:
5 | local-name: suitesparse
6 | uri: git@github.com:ethz-asl/suitesparse.git
7 | - git:
8 | local-name: cblox
9 | uri: git@github.com:ethz-asl/cblox.git
10 |
--------------------------------------------------------------------------------
/voxgraph_https.rosinstall:
--------------------------------------------------------------------------------
1 | - git:
2 | local-name: ceres_catkin
3 | uri: https://github.com/ethz-asl/ceres_catkin.git
4 | - git:
5 | local-name: suitesparse
6 | uri: https://github.com/ethz-asl/suitesparse.git
7 | - git:
8 | local-name: cblox
9 | uri: https://github.com/ethz-asl/cblox.git
10 |
--------------------------------------------------------------------------------
/voxgraph_msgs/msg/MapSurface.msg:
--------------------------------------------------------------------------------
1 | # Message header
2 | Header header
3 |
4 | # Map header encapsulating the map's main properties
5 | cblox_msgs/MapHeader map_header
6 |
7 | # Pointcloud of surface vertices
8 | # NOTE: It is expressed in the frame specified by header.frame_id
9 | sensor_msgs/PointCloud2 pointcloud
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 |
--------------------------------------------------------------------------------
/voxgraph/launch/registration_test_bench.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/common.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_COMMON_H_
2 | #define VOXGRAPH_COMMON_H_
3 |
4 | #include
5 |
6 | #include
7 |
8 | namespace voxgraph {
9 | using Transformation = voxblox::Transformation;
10 | using SubmapID = cblox::SubmapID;
11 | using SubmapIdPair = std::pair;
12 | using TransformationD = kindr::minimal::QuatTransformationTemplate;
13 | using BiasVectorType = TransformationD::Vector3;
14 | } // namespace voxgraph
15 |
16 | #endif // VOXGRAPH_COMMON_H_
17 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/tools/rosbag_helper.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_TOOLS_ROSBAG_HELPER_H_
2 | #define VOXGRAPH_TOOLS_ROSBAG_HELPER_H_
3 |
4 | #include
5 | #include
6 |
7 | namespace voxgraph {
8 | class RosbagHelper {
9 | public:
10 | explicit RosbagHelper(ros::NodeHandle node_handle);
11 |
12 | void pauseRosbag();
13 | void playRosbag();
14 |
15 | private:
16 | ros::ServiceClient rosbag_pause_srv_;
17 | std_srvs::SetBool srv_msg_;
18 | };
19 | } // namespace voxgraph
20 |
21 | #endif // VOXGRAPH_TOOLS_ROSBAG_HELPER_H_
22 |
--------------------------------------------------------------------------------
/voxgraph/src/tools/rosbag_helper.cpp:
--------------------------------------------------------------------------------
1 | #include "voxgraph/tools/rosbag_helper.h"
2 |
3 | namespace voxgraph {
4 | RosbagHelper::RosbagHelper(ros::NodeHandle node_handle) {
5 | rosbag_pause_srv_ =
6 | node_handle.serviceClient("/player/pause_playback");
7 | }
8 |
9 | void RosbagHelper::pauseRosbag() {
10 | srv_msg_.request.data = true;
11 | rosbag_pause_srv_.call(srv_msg_);
12 | }
13 |
14 | void RosbagHelper::playRosbag() {
15 | srv_msg_.request.data = false;
16 | rosbag_pause_srv_.call(srv_msg_);
17 | }
18 | } // namespace voxgraph
19 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/frontend/submap_collection/registration_point.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_FRONTEND_SUBMAP_COLLECTION_REGISTRATION_POINT_H_
2 | #define VOXGRAPH_FRONTEND_SUBMAP_COLLECTION_REGISTRATION_POINT_H_
3 |
4 | namespace voxgraph {
5 | // Small struct that can be used to store voxels or points on the isosurface
6 | struct RegistrationPoint {
7 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW
8 |
9 | voxblox::Point position;
10 | float distance;
11 | float weight;
12 | };
13 | } // namespace voxgraph
14 |
15 | #endif // VOXGRAPH_FRONTEND_SUBMAP_COLLECTION_REGISTRATION_POINT_H_
16 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/frontend/measurement_processors/gps_processor.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_FRONTEND_MEASUREMENT_PROCESSORS_GPS_PROCESSOR_H_
2 | #define VOXGRAPH_FRONTEND_MEASUREMENT_PROCESSORS_GPS_PROCESSOR_H_
3 |
4 | namespace voxgraph {
5 | // TODO(victorr): Implement this class, which would be responsible for
6 | // converting NavSatFix msgs to absolute pose measurements
7 | // that can be added to the pose graph.
8 | class GpsProcessor {
9 | public:
10 | private:
11 | };
12 | } // namespace voxgraph
13 |
14 | #endif // VOXGRAPH_FRONTEND_MEASUREMENT_PROCESSORS_GPS_PROCESSOR_H_
15 |
--------------------------------------------------------------------------------
/voxgraph/src/voxgraph_mapping_node.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include "voxgraph/frontend/voxgraph_mapper.h"
5 |
6 | int main(int argc, char** argv) {
7 | // Start logging
8 | google::InitGoogleLogging(argv[0]);
9 | google::InstallFailureSignalHandler();
10 |
11 | // Register with ROS master
12 | ros::init(argc, argv, "voxgraph_mapping");
13 |
14 | // Create node handles
15 | ros::NodeHandle nh;
16 | ros::NodeHandle nh_private("~");
17 |
18 | // Create the mapper
19 | voxgraph::VoxgraphMapper voxgraph_mapper(nh, nh_private);
20 |
21 | // Spin
22 | ros::spin();
23 |
24 | // Exit normally
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/voxgraph/launch/arche_demo.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/voxgraph/src/odometry_simulator_node.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include "voxgraph/tools/odometry_simulator/odometry_simulator.h"
5 |
6 | int main(int argc, char** argv) {
7 | // Start logging
8 | google::InitGoogleLogging(argv[0]);
9 | google::InstallFailureSignalHandler();
10 |
11 | // Register with ROS master
12 | ros::init(argc, argv, "voxgraph_odometry_simulator");
13 |
14 | // Create node handles
15 | ros::NodeHandle nh;
16 | ros::NodeHandle nh_private("~");
17 |
18 | // Create the mapper
19 | voxgraph::OdometrySimulator odometry_simulator(nh, nh_private);
20 |
21 | // Spin
22 | ros::spin();
23 |
24 | // Exit normally
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/tools/tf_helper.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_TOOLS_TF_HELPER_H_
2 | #define VOXGRAPH_TOOLS_TF_HELPER_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 |
9 | namespace voxgraph {
10 | class TfHelper {
11 | public:
12 | static void publishTransform(const voxblox::Transformation& transform,
13 | const std::string& base_frame,
14 | const std::string& target_frame,
15 | bool tf_is_static = false,
16 | const ros::Time& timestamp = ros::Time::now());
17 | };
18 | } // namespace voxgraph
19 |
20 | #endif // VOXGRAPH_TOOLS_TF_HELPER_H_
21 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/tools/visualization/pose_graph_visuals.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_TOOLS_VISUALIZATION_POSE_GRAPH_VISUALS_H_
2 | #define VOXGRAPH_TOOLS_VISUALIZATION_POSE_GRAPH_VISUALS_H_
3 |
4 | #include
5 |
6 | #include "voxgraph/backend/pose_graph.h"
7 |
8 | namespace voxgraph {
9 | class PoseGraphVisuals {
10 | public:
11 | PoseGraphVisuals() = default;
12 |
13 | void publishPoseGraph(const PoseGraph& pose_graph,
14 | const std::string& frame_id,
15 | const std::string& name_space,
16 | const ros::Publisher& publisher) const;
17 | };
18 | } // namespace voxgraph
19 |
20 | #endif // VOXGRAPH_TOOLS_VISUALIZATION_POSE_GRAPH_VISUALS_H_
21 |
--------------------------------------------------------------------------------
/voxgraph_msgs/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | voxgraph_msgs
4 | 1.0.0
5 | Message definitions for voxgraph ROS interface
6 |
7 | Victor Reijgwart
8 |
9 | Victor Reijgwart
10 |
11 | ASL 2.0
12 |
13 | catkin
14 | catkin_simple
15 |
16 | message_generation
17 | message_runtime
18 |
19 | std_msgs
20 | geometry_msgs
21 | sensor_msgs
22 | voxblox_msgs
23 | cblox_msgs
24 |
25 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/backend/local_parameterization/normalize_angle.h:
--------------------------------------------------------------------------------
1 | // NOTE: This function comes directly from the ceres::examples
2 |
3 | #ifndef VOXGRAPH_BACKEND_LOCAL_PARAMETERIZATION_NORMALIZE_ANGLE_H_
4 | #define VOXGRAPH_BACKEND_LOCAL_PARAMETERIZATION_NORMALIZE_ANGLE_H_
5 |
6 | #include
7 |
8 | namespace voxgraph {
9 | // Normalize the angle to stay within [-pi and pi) radians
10 | template
11 | inline T NormalizeAngle(const T& angle_radians) {
12 | // Use ceres::floor because it is specialized for double and Jet types.
13 | T two_pi(2.0 * M_PI);
14 | return angle_radians -
15 | two_pi * ceres::floor((angle_radians + T(M_PI)) / two_pi);
16 | }
17 | } // namespace voxgraph
18 |
19 | #endif // VOXGRAPH_BACKEND_LOCAL_PARAMETERIZATION_NORMALIZE_ANGLE_H_
20 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/backend/node/pose/pose.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_BACKEND_NODE_POSE_POSE_H_
2 | #define VOXGRAPH_BACKEND_NODE_POSE_POSE_H_
3 |
4 | #include "voxgraph/common.h"
5 |
6 | namespace voxgraph {
7 | class Pose {
8 | public:
9 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW
10 |
11 | typedef double ValueType;
12 |
13 | explicit Pose(const Transformation& initial_pose) {
14 | initial_pose_vec_ = initial_pose.log();
15 | }
16 |
17 | ~Pose() = default;
18 |
19 | virtual operator Transformation() const = 0; // NOLINT
20 |
21 | virtual ValueType* optimizationVectorData() = 0;
22 | virtual size_t optimizationVectorSize() const = 0;
23 |
24 | protected:
25 | Transformation::Vector6 initial_pose_vec_;
26 | };
27 | } // namespace voxgraph
28 |
29 | #endif // VOXGRAPH_BACKEND_NODE_POSE_POSE_H_
30 |
--------------------------------------------------------------------------------
/voxgraph/src/backend/node/pose/pose_6d.cpp:
--------------------------------------------------------------------------------
1 | #include "voxgraph/backend/node/pose/pose_6d.h"
2 |
3 | namespace voxgraph {
4 | Pose6D::Pose6D(const Transformation& initial_pose) : Pose(initial_pose) {
5 | // Initialize the optimization variables
6 | // TODO(victorr): Replace this with the appropriate std method
7 | for (int i = 0; i < 6; i++) {
8 | r3_so3_vector_[i] = initial_pose_vec_[i];
9 | }
10 | }
11 |
12 | Pose6D::operator Transformation() const {
13 | // Convert the optimization array to a minkindr compatible type
14 | Transformation::Vector6 T_vec_6d;
15 | // TODO(victorr): Replace this with the appropriate std method
16 | for (int i = 0; i < 6; i++) {
17 | T_vec_6d[i] = r3_so3_vector_[i];
18 | }
19 |
20 | return Transformation::exp(T_vec_6d);
21 | }
22 | } // namespace voxgraph
23 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/backend/node/submap_node.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_BACKEND_NODE_SUBMAP_NODE_H_
2 | #define VOXGRAPH_BACKEND_NODE_SUBMAP_NODE_H_
3 |
4 | #include
5 |
6 | #include
7 |
8 | #include "voxgraph/backend/node/node.h"
9 |
10 | namespace voxgraph {
11 | class SubmapNode : public Node {
12 | public:
13 | typedef std::shared_ptr Ptr;
14 | typedef cblox::SubmapID SubmapId;
15 |
16 | struct Config : Node::Config {
17 | SubmapId submap_id;
18 | };
19 |
20 | SubmapNode(const NodeId& node_id, const Config& config)
21 | : Node(node_id, config), config_(config) {}
22 |
23 | cblox::SubmapID getSubmapId() const { return config_.submap_id; }
24 |
25 | private:
26 | Config config_;
27 | };
28 | } // namespace voxgraph
29 |
30 | #endif // VOXGRAPH_BACKEND_NODE_SUBMAP_NODE_H_
31 |
--------------------------------------------------------------------------------
/voxgraph/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | voxgraph
4 | 1.0.0
5 | Pose graph optimization of voxblox submaps
6 |
7 | Victor Reijgwart
8 |
9 | Victor Reijgwart
10 |
11 | ASL 2.0
12 |
13 | catkin
14 | catkin_simple
15 |
16 | roscpp
17 | voxblox
18 | voxblox_ros
19 | cblox
20 | cblox_ros
21 | ceres_catkin
22 | eigen_catkin
23 |
24 | voxblox_msgs
25 | cblox_msgs
26 | voxgraph_msgs
27 |
28 |
29 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/backend/node/reference_frame_node.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_BACKEND_NODE_REFERENCE_FRAME_NODE_H_
2 | #define VOXGRAPH_BACKEND_NODE_REFERENCE_FRAME_NODE_H_
3 |
4 | #include
5 |
6 | #include "voxgraph/backend/node/node.h"
7 |
8 | namespace voxgraph {
9 | class ReferenceFrameNode : public Node {
10 | public:
11 | typedef std::shared_ptr Ptr;
12 | typedef unsigned int FrameId;
13 |
14 | struct Config : Node::Config {
15 | FrameId reference_frame_id;
16 | };
17 |
18 | ReferenceFrameNode(const NodeId& node_id, const Config& config)
19 | : Node(node_id, config), config_(config) {}
20 |
21 | FrameId getReferenceFrameId() const { return config_.reference_frame_id; }
22 |
23 | private:
24 | Config config_;
25 | };
26 | } // namespace voxgraph
27 |
28 | #endif // VOXGRAPH_BACKEND_NODE_REFERENCE_FRAME_NODE_H_
29 |
--------------------------------------------------------------------------------
/voxgraph/config/odometry_simulator.yaml:
--------------------------------------------------------------------------------
1 | debug: true
2 | subscriber_queue_length: 100
3 | subscribe_to_odom_topic: "/firefly/ground_truth/odometry"
4 | published_mission_frame: "odom"
5 | published_simulated_base_frame: "base"
6 | published_original_base_frame: "base_ground_truth"
7 |
8 | odometry_noise:
9 | velocity:
10 | x:
11 | mean: 0.05
12 | stddev: 0.01
13 | y:
14 | mean: 0.05
15 | stddev: 0.01
16 | z:
17 | mean: 0.0001
18 | stddev: 0.0001
19 | yaw:
20 | mean: 0.005
21 | stddev: 0.00001
22 | position:
23 | x:
24 | mean: 0
25 | stddev: 0
26 | y:
27 | mean: 0
28 | stddev: 0
29 | z:
30 | mean: 0
31 | stddev: 0
32 | yaw:
33 | mean: 0
34 | stddev: 0
35 | pitch:
36 | mean: 0
37 | stddev: 0
38 | roll:
39 | mean: 0
40 | stddev: 0
41 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/frontend/submap_collection/bounding_box.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_FRONTEND_SUBMAP_COLLECTION_BOUNDING_BOX_H_
2 | #define VOXGRAPH_FRONTEND_SUBMAP_COLLECTION_BOUNDING_BOX_H_
3 |
4 | #include
5 | #include
6 |
7 | namespace voxgraph {
8 | typedef Eigen::Matrix BoxCornerMatrix;
9 | class BoundingBox {
10 | public:
11 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW
12 |
13 | voxblox::Point min = {INFINITY, INFINITY, INFINITY};
14 | voxblox::Point max = {-INFINITY, -INFINITY, -INFINITY};
15 |
16 | void reset();
17 |
18 | const BoxCornerMatrix getCornerCoordinates() const;
19 |
20 | static const BoundingBox getAabbFromObbAndPose(
21 | const BoundingBox& obb, const voxblox::Transformation& pose);
22 | };
23 | } // namespace voxgraph
24 |
25 | #endif // VOXGRAPH_FRONTEND_SUBMAP_COLLECTION_BOUNDING_BOX_H_
26 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/backend/node/pose/pose_6d.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_BACKEND_NODE_POSE_POSE_6D_H_
2 | #define VOXGRAPH_BACKEND_NODE_POSE_POSE_6D_H_
3 |
4 | #include "voxgraph/backend/node/pose/pose.h"
5 |
6 | namespace voxgraph {
7 | class Pose6D : public Pose {
8 | public:
9 | typedef std::array R3So3Vector;
10 |
11 | // Converting constructor from minkindr
12 | explicit Pose6D(const Transformation& initial_pose);
13 |
14 | // User defined conversion to minkindr
15 | operator Transformation() const final; // NOLINT
16 |
17 | R3So3Vector::value_type* optimizationVectorData() final {
18 | return r3_so3_vector_.data();
19 | }
20 |
21 | size_t optimizationVectorSize() const final { return r3_so3_vector_.size(); }
22 |
23 | private:
24 | R3So3Vector r3_so3_vector_;
25 | };
26 | } // namespace voxgraph
27 |
28 | #endif // VOXGRAPH_BACKEND_NODE_POSE_POSE_6D_H_
29 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/backend/node/pose/pose_4d.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_BACKEND_NODE_POSE_POSE_4D_H_
2 | #define VOXGRAPH_BACKEND_NODE_POSE_POSE_4D_H_
3 |
4 | #include "voxgraph/backend/node/pose/pose.h"
5 |
6 | namespace voxgraph {
7 | class Pose4D : public Pose {
8 | public:
9 | typedef std::array XyzYawVector;
10 |
11 | // Converting constructor from minkindr
12 | explicit Pose4D(const Transformation& initial_pose);
13 |
14 | // User defined conversion to minkindr
15 | operator Transformation() const final; // NOLINT
16 |
17 | XyzYawVector::value_type* optimizationVectorData() final {
18 | return xyz_yaw_vector_.data();
19 | }
20 |
21 | size_t optimizationVectorSize() const final { return xyz_yaw_vector_.size(); }
22 |
23 | private:
24 | XyzYawVector xyz_yaw_vector_;
25 | };
26 | } // namespace voxgraph
27 |
28 | #endif // VOXGRAPH_BACKEND_NODE_POSE_POSE_4D_H_
29 |
--------------------------------------------------------------------------------
/voxgraph/src/backend/node/node.cpp:
--------------------------------------------------------------------------------
1 | #include "voxgraph/backend/node/node.h"
2 |
3 | namespace voxgraph {
4 | void Node::addToProblem(ceres::Problem* problem,
5 | ceres::LocalParameterization* local_parameterization) {
6 | CHECK_NOTNULL(problem);
7 | CHECK_NOTNULL(local_parameterization);
8 |
9 | // Add the node to the solver and set it to be held constant if appropriate
10 | problem->AddParameterBlock(optimized_pose_.optimizationVectorData(),
11 | optimized_pose_.optimizationVectorSize());
12 | if (config_.set_constant) {
13 | problem->SetParameterBlockConstant(
14 | optimized_pose_.optimizationVectorData());
15 | }
16 |
17 | // Set the local parameterization s.t. yaw stays normalized
18 | problem->SetParameterization(getPosePtr()->optimizationVectorData(),
19 | local_parameterization);
20 | }
21 | } // namespace voxgraph
22 |
--------------------------------------------------------------------------------
/voxgraph/src/backend/node/pose/pose_4d.cpp:
--------------------------------------------------------------------------------
1 | #include "voxgraph/backend/node/pose/pose_4d.h"
2 |
3 | namespace voxgraph {
4 | Pose4D::Pose4D(const Transformation& initial_pose) : Pose(initial_pose) {
5 | // Initialize the optimization variables
6 | xyz_yaw_vector_[0] = initial_pose_vec_[0];
7 | xyz_yaw_vector_[1] = initial_pose_vec_[1];
8 | xyz_yaw_vector_[2] = initial_pose_vec_[2];
9 | xyz_yaw_vector_[3] = initial_pose_vec_[5];
10 | }
11 |
12 | Pose4D::operator Transformation() const {
13 | Transformation::Vector6 T_vec_6d;
14 | // Set x, y, z and yaw from the optimization variables
15 | T_vec_6d[0] = xyz_yaw_vector_[0];
16 | T_vec_6d[1] = xyz_yaw_vector_[1];
17 | T_vec_6d[2] = xyz_yaw_vector_[2];
18 | T_vec_6d[5] = xyz_yaw_vector_[3];
19 | // Set pitch and roll to zero from the initial pose
20 | T_vec_6d[3] = initial_pose_vec_[3];
21 | T_vec_6d[4] = initial_pose_vec_[4];
22 | return Transformation::exp(T_vec_6d);
23 | }
24 | } // namespace voxgraph
25 |
--------------------------------------------------------------------------------
/voxgraph/src/backend/constraint/constraint_collection.cpp:
--------------------------------------------------------------------------------
1 | #include "voxgraph/backend/constraint/constraint_collection.h"
2 |
3 | namespace voxgraph {
4 | void ConstraintCollection::addConstraintsToProblem(
5 | const NodeCollection& node_collection, ceres::Problem* problem_ptr,
6 | bool exclude_registration_constraints) {
7 | CHECK_NOTNULL(problem_ptr);
8 |
9 | // Add all constraints of the appropriate types to the problem
10 | for (Constraint& absolute_pose_constraint : absolute_pose_constraints_) {
11 | absolute_pose_constraint.addToProblem(node_collection, problem_ptr);
12 | }
13 | for (Constraint& relative_pose_constraint : relative_pose_constraints_) {
14 | relative_pose_constraint.addToProblem(node_collection, problem_ptr);
15 | }
16 | if (!exclude_registration_constraints) {
17 | for (Constraint& registration_constraint : registration_constraints_) {
18 | registration_constraint.addToProblem(node_collection, problem_ptr);
19 | }
20 | }
21 | }
22 | } // namespace voxgraph
23 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/frontend/pose_graph_interface/node_templates.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_FRONTEND_POSE_GRAPH_INTERFACE_NODE_TEMPLATES_H_
2 | #define VOXGRAPH_FRONTEND_POSE_GRAPH_INTERFACE_NODE_TEMPLATES_H_
3 |
4 | #include "voxgraph/backend/node/reference_frame_node.h"
5 | #include "voxgraph/backend/node/submap_node.h"
6 |
7 | namespace voxgraph {
8 | class NodeTemplates {
9 | public:
10 | enum ReferenceFrames : ReferenceFrameNode::FrameId {
11 | kMissionFrame,
12 | kGpsFrame
13 | };
14 |
15 | NodeTemplates();
16 |
17 | ReferenceFrameNode::Config getReferenceFrameConfigById(
18 | ReferenceFrameNode::FrameId frame_id);
19 |
20 | const ReferenceFrameNode::Config& mission_frame;
21 | const ReferenceFrameNode::Config& gps_frame;
22 | const SubmapNode::Config& submap;
23 |
24 | private:
25 | ReferenceFrameNode::Config mission_frame_;
26 | ReferenceFrameNode::Config gps_frame_;
27 | SubmapNode::Config submap_;
28 | };
29 | } // namespace voxgraph
30 |
31 | #endif // VOXGRAPH_FRONTEND_POSE_GRAPH_INTERFACE_NODE_TEMPLATES_H_
32 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/backend/constraint/absolute_pose_constraint.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_BACKEND_CONSTRAINT_ABSOLUTE_POSE_CONSTRAINT_H_
2 | #define VOXGRAPH_BACKEND_CONSTRAINT_ABSOLUTE_POSE_CONSTRAINT_H_
3 |
4 | #include
5 |
6 | #include "voxgraph/backend/constraint/constraint.h"
7 |
8 | namespace voxgraph {
9 | class AbsolutePoseConstraint : public Constraint {
10 | public:
11 | typedef std::shared_ptr Ptr;
12 | struct Config : Constraint::Config {
13 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW
14 | ReferenceFrameNode::FrameId reference_frame_id;
15 | cblox::SubmapID submap_id;
16 | voxblox::Transformation T_ref_submap;
17 | };
18 |
19 | AbsolutePoseConstraint(ConstraintId constraint_id, const Config& config)
20 | : Constraint(constraint_id, config), config_(config) {}
21 |
22 | void addToProblem(const NodeCollection& node_collection,
23 | ceres::Problem* problem) final;
24 |
25 | private:
26 | const Config config_;
27 | };
28 | } // namespace voxgraph
29 |
30 | #endif // VOXGRAPH_BACKEND_CONSTRAINT_ABSOLUTE_POSE_CONSTRAINT_H_
31 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/backend/constraint/relative_pose_constraint.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_BACKEND_CONSTRAINT_RELATIVE_POSE_CONSTRAINT_H_
2 | #define VOXGRAPH_BACKEND_CONSTRAINT_RELATIVE_POSE_CONSTRAINT_H_
3 |
4 | #include
5 |
6 | #include "voxgraph/backend/constraint/constraint.h"
7 |
8 | namespace voxgraph {
9 | class RelativePoseConstraint : public Constraint {
10 | public:
11 | typedef std::shared_ptr Ptr;
12 | struct Config : Constraint::Config {
13 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW
14 | cblox::SubmapID origin_submap_id;
15 | cblox::SubmapID destination_submap_id;
16 | voxblox::Transformation T_origin_destination;
17 | };
18 |
19 | RelativePoseConstraint(ConstraintId constraint_id, const Config& config)
20 | : Constraint(constraint_id, config), config_(config) {}
21 |
22 | void addToProblem(const NodeCollection& node_collection,
23 | ceres::Problem* problem) final;
24 |
25 | private:
26 | const Config config_;
27 | };
28 | } // namespace voxgraph
29 |
30 | #endif // VOXGRAPH_BACKEND_CONSTRAINT_RELATIVE_POSE_CONSTRAINT_H_
31 |
--------------------------------------------------------------------------------
/voxgraph/include/voxgraph/frontend/submap_collection/submap_timeline.h:
--------------------------------------------------------------------------------
1 | #ifndef VOXGRAPH_FRONTEND_SUBMAP_COLLECTION_SUBMAP_TIMELINE_H_
2 | #define VOXGRAPH_FRONTEND_SUBMAP_COLLECTION_SUBMAP_TIMELINE_H_
3 |
4 | #include
5 | #include