My Project 1.0
Holistic Fusion: A Generic Framework for Multimodal Sensor Fusion
Loading...
Searching...
No Matches
StaticTransformsTf.cpp
Go to the documentation of this file.
1/*
2Copyright 2022 by Julian Nubert, Robotic Systems Lab, ETH Zurich.
3All rights reserved.
4This file is released under the "BSD-3-Clause License".
5Please see the LICENSE file that has been included as part of this package.
6 */
7
8// Implementation
10
11// ROS
12#include <ros/ros.h>
13
14// Workspace
17
18namespace holistic_fusion {
19
21 // Print to console --------------------------
22 REGULAR_COUT << " Looking up transforms in TF-tree." << std::endl;
23 REGULAR_COUT << " Transforms between the following frames are required: " << imuFrame_ << ", " << baseLinkFrame_ << std::endl;
24 REGULAR_COUT << " Waiting for up to 100 seconds until they arrive..." << std::endl;
25
26 // Temporary variable
27 static tf::StampedTransform transform;
28
29 // Look up transforms ----------------------------
30 // Sleep before subscribing, otherwise sometimes dying in the beginning of rosbag
31 ros::Rate rosRate(10);
32 rosRate.sleep();
33
34 // Imu to Base ---
35 REGULAR_COUT << " Looking up transform from " << imuFrame_ << " to " << baseLinkFrame_ << std::endl;
36 listener_.waitForTransform(imuFrame_, baseLinkFrame_, ros::Time(0), ros::Duration(100.0));
37 listener_.lookupTransform(imuFrame_, baseLinkFrame_, ros::Time(0), transform);
38 // I_Base
40 REGULAR_COUT << " Translation I_Base: " << rv_T_frame1_frame2(imuFrame_, baseLinkFrame_).translation() << std::endl;
41 // Base_I
43
44 // Wrapping up --------------------------
45 REGULAR_COUT << " Transforms looked up successfully." << std::endl;
46 return true;
47}
48
49} // namespace holistic_fusion
#define REGULAR_COUT
Eigen::Isometry3d & lv_T_frame1_frame2(const std::string &frame1, const std::string &frame2)
const Eigen::Isometry3d & rv_T_frame1_frame2(const std::string &frame1, const std::string &frame2) const
void tfToIsometry3(const tf::Transform &tf_T, Eigen::Isometry3d &T)