Skip to content

Commit df6f988

Browse files
author
lamprecht
committed
started tf_cb
1 parent 6df5f06 commit df6f988

19 files changed

+132
-760
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ find_package(catkin REQUIRED COMPONENTS
1515
std_msgs
1616
geometry_msgs
1717
sensor_msgs
18+
tf2_msgs
1819
)
1920

2021
#find_package(OpenCV REQUIRED)
@@ -116,7 +117,7 @@ find_package(catkin REQUIRED COMPONENTS
116117
catkin_package(
117118
INCLUDE_DIRS include
118119
LIBRARIES ${PROJECT_NAME}
119-
CATKIN_DEPENDS roscpp tf std_msgs geometry_msgs sensor_msgs
120+
CATKIN_DEPENDS roscpp tf std_msgs geometry_msgs sensor_msgs tf2_msgs
120121
# DEPENDS system_lib
121122
)
122123
# |^ rviz_visual_tools deleted in catkin depends.

data/tf_example1.bag

46.3 KB
Binary file not shown.

include/tf_mapping/helper.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <iostream>
2+
3+
// macro to convert a string to a double
4+
#define SSTR(x) static_cast<std::ostringstream&>(std::ostringstream() << std::dec << x).str()
5+
6+
//macro to round a value to 2 digits
7+
#define ROUND2(x) std::round(x * 100) / 100
8+
#define ROUND3(x) std::round(x * 1000) / 1000
9+
10+
11+
12+
namespace tf_mapping
13+
{
14+
15+
int getNumOfString(std::string str);
16+
17+
18+
19+
}

include/tf_mapping/tf_mapping_node.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// #include <tf/transform_listener.h>
99

1010
// messages
11-
// #include <geometry_msgs/PoseStamped.h>
11+
//#include <geometry_msgs/TransformStamped.h>
12+
#include <tf2_msgs/TFMessage.h>
13+
1214
// #include <geometry_msgs/PoseArray.h>
1315
// #include <sensor_msgs/CameraInfo.h>
1416
// #include <sensor_msgs/image_encodings.h>
@@ -28,6 +30,7 @@ class TfMappingNode
2830

2931
protected:
3032
// ROS API callbacks
33+
void input_tfCb(const tf2_msgs::TFMessageConstPtr& msg);
3134
// void imageCb(const sensor_msgs::ImageConstPtr& image);
3235
// void updateParamsCb(const std_msgs::Float64& msg);
3336

@@ -36,19 +39,23 @@ class TfMappingNode
3639

3740

3841
// class members
42+
int first_tf_id_;
43+
int tf_counter_;
44+
bool first_tf_detected_;
45+
tf2_msgs::TFMessageConstPtr tf_msg_;
3946
//tf::TransformListener tf_listener_;
4047
//Detector::Ptr detector_;
4148

4249
//sensor_msgs::CameraInfo camera_info_;
4350

4451
// parameters (set in yaml file)
45-
std::string world_frame_;
52+
//std::string world_frame_;
4653

4754

4855
// subscriber
4956
// image_transport::Subscriber img_sub_;
5057
// ros::Subscriber init_pos_sub_; // remove position error!
51-
// ros::Subscriber update_params_sub_;
58+
ros::Subscriber input_tf_sub_;
5259

5360
// publisher
5461
// image_transport::Publisher binary_img_pub_;

launch/ball_tracking.launch

Lines changed: 0 additions & 19 deletions
This file was deleted.

launch/start_ball_tracking.launch

Lines changed: 0 additions & 266 deletions
This file was deleted.

0 commit comments

Comments
 (0)