Skip to content

Commit 6df5f06

Browse files
author
lamprecht
committed
created empty tf_mapping works to build
0 parents  commit 6df5f06

19 files changed

+1264
-0
lines changed

CMakeLists.txt

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(tf_mapping)
3+
4+
## Compile as C++11, supported in ROS Kinetic and newer
5+
add_compile_options(-std=c++11)
6+
7+
set(CMAKE_BUILD_TYPE Debug)
8+
9+
## Find catkin macros and libraries
10+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
11+
## is used, also find other catkin packages
12+
find_package(catkin REQUIRED COMPONENTS
13+
roscpp
14+
tf
15+
std_msgs
16+
geometry_msgs
17+
sensor_msgs
18+
)
19+
20+
#find_package(OpenCV REQUIRED)
21+
22+
## System dependencies are found with CMake's conventions
23+
# find_package(Boost REQUIRED COMPONENTS system)
24+
25+
26+
## Uncomment this if the package has a setup.py. This macro ensures
27+
## modules and global scripts declared therein get installed
28+
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
29+
# catkin_python_setup()
30+
31+
################################################
32+
## Declare ROS messages, services and actions ##
33+
################################################
34+
35+
## To declare and build messages, services or actions from within this
36+
## package, follow these steps:
37+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
38+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
39+
## * In the file package.xml:
40+
## * add a build_depend tag for "message_generation"
41+
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
42+
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
43+
## but can be declared for certainty nonetheless:
44+
## * add a run_depend tag for "message_runtime"
45+
## * In this file (CMakeLists.txt):
46+
## * add "message_generation" and every package in MSG_DEP_SET to
47+
## find_package(catkin REQUIRED COMPONENTS ...)
48+
## * add "message_runtime" and every package in MSG_DEP_SET to
49+
## catkin_package(CATKIN_DEPENDS ...)
50+
## * uncomment the add_*_files sections below as needed
51+
## and list every .msg/.srv/.action file to be processed
52+
## * uncomment the generate_messages entry below
53+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
54+
55+
## Generate messages in the 'msg' folder
56+
# add_message_files(
57+
# FILES
58+
# Message1.msg
59+
# Message2.msg
60+
# )
61+
62+
## Generate services in the 'srv' folder
63+
# add_service_files(
64+
# FILES
65+
# Service1.srv
66+
# Service2.srv
67+
# )
68+
69+
## Generate actions in the 'action' folder
70+
# add_action_files(
71+
# FILES
72+
# Action1.action
73+
# Action2.action
74+
# )
75+
76+
## Generate added messages and services with any dependencies listed here
77+
# generate_messages(
78+
# DEPENDENCIES
79+
# std_msgs # Or other packages containing msgs
80+
# )
81+
82+
################################################
83+
## Declare ROS dynamic reconfigure parameters ##
84+
################################################
85+
86+
## To declare and build dynamic reconfigure parameters within this
87+
## package, follow these steps:
88+
## * In the file package.xml:
89+
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
90+
## * In this file (CMakeLists.txt):
91+
## * add "dynamic_reconfigure" to
92+
## find_package(catkin REQUIRED COMPONENTS ...)
93+
## * uncomment the "generate_dynamic_reconfigure_options" section below
94+
## and list every .cfg file to be processed
95+
96+
## Generate dynamic reconfigure parameters in the 'cfg' folder
97+
# generate_dynamic_reconfigure_options(
98+
# cfg/DynReconf1.cfg
99+
# cfg/DynReconf2.cfg
100+
# )
101+
102+
###################################
103+
## catkin specific configuration ##
104+
###################################
105+
## The catkin_package macro generates cmake config files for your package
106+
## Declare things to be passed to dependent projects
107+
## INCLUDE_DIRS: uncomment this if you package contains header files
108+
## LIBRARIES: libraries you create in this project that dependent projects also need
109+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
110+
## DEPENDS: system dependencies of this project that dependent projects also need
111+
#catkin_package(
112+
# INCLUDE_DIRS include
113+
# LIBRARIES ${PROJECT_NAME}
114+
# CATKIN_DEPENDS roscpp std_msgs sensor_msgs control_msgs
115+
# DEPENDS system_lib)
116+
catkin_package(
117+
INCLUDE_DIRS include
118+
LIBRARIES ${PROJECT_NAME}
119+
CATKIN_DEPENDS roscpp tf std_msgs geometry_msgs sensor_msgs
120+
# DEPENDS system_lib
121+
)
122+
# |^ rviz_visual_tools deleted in catkin depends.
123+
###########
124+
## Build ##
125+
###########
126+
127+
## Specify additional locations of header files
128+
## Your package locations should be listed before other locations
129+
include_directories(
130+
include ${catkin_INCLUDE_DIRS}
131+
)
132+
133+
## Specify additional locations of header files
134+
set(HEADERSx
135+
include/${PROJECT_NAME}/tf_mapping_node.h
136+
include/${PROJECT_NAME}/helper.h
137+
)
138+
139+
set(SOURCES
140+
src/helper.cpp
141+
)
142+
143+
## Declare a cpp library
144+
add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS})
145+
146+
## Declare a cpp executable
147+
add_executable(tf_mapping_node src/tf_mapping_node.cpp)
148+
149+
## Add cmake target dependencies of the executable/library
150+
## as an example, message headers may need to be generated before nodes
151+
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
152+
153+
## Specify libraries to link a library or executable target against
154+
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})
155+
target_link_libraries(tf_mapping_node ${PROJECT_NAME} )
156+
157+
#############
158+
## Install ##
159+
#############
160+
161+
# all install targets should use catkin DESTINATION variables
162+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
163+
164+
## Mark executable scripts (Python etc.) for installation
165+
## in contrast to setup.py, you can choose the destination
166+
# install(PROGRAMS
167+
# scripts/my_python_script
168+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
169+
# )
170+
171+
## Mark executables and/or libraries for installation
172+
# install(TARGETS ${PROJECT_NAME} tf_mapping_node
173+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
174+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
175+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
176+
# )
177+
178+
# ## Mark other files for installation (e.g. launch and bag files, etc.)
179+
# install(DIRECTORY launch
180+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
181+
# FILES_MATCHING PATTERN "*.launch"
182+
# PATTERN "*~" EXCLUDE
183+
# )
184+
185+
# install(DIRECTORY config
186+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
187+
# PATTERN "*~" EXCLUDE
188+
# )
189+
190+
#############
191+
## Testing ##
192+
#############
193+
194+
## Add gtest based cpp test target and link libraries
195+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_turtlebot3_arm_controller_exercise.cpp)
196+
# if(TARGET ${PROJECT_NAME}-test)
197+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
198+
# endif()
199+
200+
## Add folders to be run by python nosetests
201+
# catkin_add_nosetests(test)

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Software License Agreement (BSD License)
2+
3+
Copyright (c) 2018, Markus Lamprecht (MarkusLamprecht@live.de)
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of Markus Lamprecht be used to endorse or promote
17+
products derived from this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# tf_mapping
2+
3+
4+
TODO
5+
![aruco_detector_example](https://github.com/CesMak/aruco_detector_ocv/blob/master/data/rviz_example.png)
6+
7+
The aruco_detector_osv (aruco_detector_opencv) uses the #include <opencv2/aruco.hpp> library instead of using #include <aruco/aruco.h> (ros-kinetic-aruco). This package was tested on ubuntu 16.04, ROS Kinetic with a Logitech C920 camera.
8+
9+
With this package you are able to:
10+
11+
* detect position and orientation of an [aruco marker](http://chev.me/arucogen/) relatively to the camera. The corresponding **tf** is published.
12+
* a certainty parameter of how robust the arcuco marker is detected.
13+
* a result image with the detected markers highlighted is published.
14+
15+
Please calibrate your camera first using: [camera_calibration](http://wiki.ros.org/camera_calibration).
16+
17+
If you get (when using the camera)
18+
19+
```
20+
[ERROR] [1551630633.628039127]: Cannot identify '/dev/video0': 2, No such file or directory
21+
```
22+
23+
do
24+
25+
```
26+
sudo modprobe uvcvideo
27+
```
28+
29+
See all adjustments in the **aruco_detector_osv/launch/detector.launch**
30+
31+
## Installation
32+
install dependencies, git, use ros kinetic, ubuntu 16.04.
33+
34+
```
35+
cd ~/Desktop
36+
source /opt/ros/kinetic/setup.bash
37+
mkdir -p catkin_ws/src
38+
cd catkin_ws/src/
39+
git clone git@github.com:CesMak/aruco_detector_ocv.git (takes some time due to included bag to test this package)
40+
cd ..
41+
catkin init -w .
42+
catkin build
43+
source devel/setup.bash
44+
roscd roscd aruco_detector_ocv/data/
45+
rosbag decompress 640x480_logitech_aruco3_compressed.orig.bag
46+
roslaunch aruco_detector_ocv detector.launch
47+
```
48+
49+
50+
## Launch
51+
52+
```
53+
roslaunch aruco_detector_ocv detector.launch
54+
```
55+
56+
57+
## Dependencies:
58+
cv_bridge image_geometry geometry_msgs roscpp rospy std_msgs tf2 tf2_ros image_transport std_msgs
59+
60+
## Further adjustements
61+
62+
There are many opencv parameters that can be adjusted internally to reduce the effect of lightening conditions.
63+
See [opencv_tutorial](https://docs.opencv.org/3.1.0/d5/dae/tutorial_aruco_detection.html)
64+
65+
In order to adjust camera options use **scripts/marker_filter.py**
66+
67+
## License BSD
68+
If you want to use this package please contact: [me](https://simact.de/about_me).
69+

include/tf_mapping/helper.h

Whitespace-only changes.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#ifndef TF_MAPPING_NODE_H__
2+
#define TF_MAPPING_NODE_H__
3+
4+
#include <ros/ros.h>
5+
6+
// other
7+
// #include <actionlib/server/simple_action_server.h>
8+
// #include <tf/transform_listener.h>
9+
10+
// messages
11+
// #include <geometry_msgs/PoseStamped.h>
12+
// #include <geometry_msgs/PoseArray.h>
13+
// #include <sensor_msgs/CameraInfo.h>
14+
// #include <sensor_msgs/image_encodings.h>
15+
16+
namespace tf_mapping
17+
{
18+
class TfMappingNode
19+
{
20+
public:
21+
//typedef actionlib::SimpleActionServer<ball_tracking_msgs::GetBallStatesAction> GetBallStatesActionServer;
22+
23+
TfMappingNode(ros::NodeHandle& nh);
24+
virtual ~TfMappingNode();
25+
26+
void update();
27+
28+
29+
protected:
30+
// ROS API callbacks
31+
// void imageCb(const sensor_msgs::ImageConstPtr& image);
32+
// void updateParamsCb(const std_msgs::Float64& msg);
33+
34+
// helper
35+
//void transformPoint(const tf::StampedTransform& transform, const geometry_msgs::Point& point_in, geometry_msgs::Point& point_out) const;
36+
37+
38+
// class members
39+
//tf::TransformListener tf_listener_;
40+
//Detector::Ptr detector_;
41+
42+
//sensor_msgs::CameraInfo camera_info_;
43+
44+
// parameters (set in yaml file)
45+
std::string world_frame_;
46+
47+
48+
// subscriber
49+
// image_transport::Subscriber img_sub_;
50+
// ros::Subscriber init_pos_sub_; // remove position error!
51+
// ros::Subscriber update_params_sub_;
52+
53+
// publisher
54+
// image_transport::Publisher binary_img_pub_;
55+
// ros::Publisher ball_states_pub_;
56+
57+
58+
// action server
59+
//boost::shared_ptr<GetBallStatesActionServer> get_ball_states_as_;
60+
};
61+
}
62+
63+
#endif

launch/ball_tracking.launch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<launch>
3+
<arg name="update_rate" default="60" />
4+
<arg name="show_debug_img" default="true" />
5+
<arg name="ball_color" default="" />
6+
7+
<!-- load config into parameter server -->
8+
<rosparam file="$(find ball_tracking_rgb)/config/ball_tracking_config_$(arg ball_color).yaml" command="load" />
9+
<param name="ball_tracking_rgb/update_rate" type="int" value="$(arg update_rate)" />
10+
<param name="ball_tracking_rgb/img_output_path" type="string" value="$(find ball_tracking_rgb)/img/" />
11+
<param name="ball_tracking_rgb/show_debug_img" type="boolean" value="$(arg show_debug_img)" />
12+
13+
<!-- start ball tracking node -->
14+
<node name="ball_tracking_rgb" pkg="ball_tracking_rgb" type="ball_tracking_node" output="screen" />
15+
16+
<!-- start ball model vis node -->
17+
<!-- only works in indigo -->
18+
<node name="ball_tracking_rgb_vis" pkg="ball_tracking_rgb" type="ball_model_vis_node" output="screen" />
19+
</launch>

0 commit comments

Comments
 (0)