Skip to content

Commit 996ef31

Browse files
author
Taehun Lim
authored
Merge pull request #4 from kijongGil/master
added turtlebot3 automatic_parking
2 parents b1ced4f + e4a8b7f commit 996ef31

File tree

4 files changed

+277
-64
lines changed

4 files changed

+277
-64
lines changed
Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
################################################################################
2+
# CMake
3+
################################################################################
14
cmake_minimum_required(VERSION 2.8.3)
25
project(turtlebot3_automatic_parking)
36

4-
## Add support for C++11, supported in ROS Kinetic and newer
5-
# add_definitions(-std=c++11)
6-
7-
## Find catkin macros and libraries
8-
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
9-
## is used, also find other catkin packages
7+
################################################################################
8+
# Packages
9+
################################################################################
1010
find_package(catkin REQUIRED COMPONENTS
1111
rospy
1212
sensor_msgs
@@ -15,25 +15,36 @@ find_package(catkin REQUIRED COMPONENTS
1515
geometry_msgs
1616
)
1717

18-
include_directories(
19-
${catkin_INCLUDE_DIRS}
20-
)
18+
################################################################################
19+
# Declare ROS messages, services and actions
20+
################################################################################
21+
22+
################################################################################
23+
# Declare ROS dynamic reconfigure parameters
24+
################################################################################
2125

26+
################################################################################
27+
# Catkin specific configuration
28+
################################################################################
2229
catkin_package(
23-
# INCLUDE_DIRS include
24-
# LIBRARIES people_detect
25-
CATKIN_DEPENDS
30+
#INCLUDE_DIRS include
31+
CATKIN_DEPENDS rospy sensor_msgs std_msgs nav_msgs geometry_msgs
2632
)
2733

28-
catkin_install_python(PROGRAMS src/automatic_parking.py
29-
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
30-
###########
31-
## Build ##
32-
###########
33-
34+
################################################################################
35+
# Build
36+
################################################################################
3437
include_directories(
38+
include
3539
${catkin_INCLUDE_DIRS}
3640
)
3741

42+
################################################################################
43+
# Install
44+
################################################################################
45+
catkin_install_python(PROGRAMS src/automatic_parking.py
46+
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
47+
)
48+
3849

3950

turtlebot3_automatic_parking/package.xml

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,16 @@
22
<package>
33
<name>turtlebot3_automatic_parking</name>
44
<version>0.0.0</version>
5-
<description>The turtlebot3_automatic_parking package</description>
6-
7-
<!-- One maintainer tag required, multiple allowed, one person per tag -->
8-
<!-- Example: -->
9-
<!-- <maintainer email="[email protected]">Jane Doe</maintainer> -->
10-
<maintainer email="[email protected]">robotis</maintainer>
11-
12-
13-
<!-- One license tag required, multiple allowed, one license per tag -->
14-
<!-- Commonly used license strings: -->
15-
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
16-
<license>TODO</license>
17-
18-
19-
<!-- Url tags are optional, but multiple are allowed, one per tag -->
20-
<!-- Optional attribute type can be: website, bugtracker, or repository -->
21-
<!-- Example: -->
22-
<!-- <url type="website">http://wiki.ros.org/turtlebot3_follower</url> -->
23-
24-
25-
<!-- Author tags are optional, multiple are allowed, one per tag -->
26-
<!-- Authors do not have to be maintainers, but could be -->
27-
<!-- Example: -->
28-
<!-- <author email="[email protected]">Jane Doe</author> -->
29-
30-
31-
<!-- The *_depend tags are used to specify dependencies -->
32-
<!-- Dependencies can be catkin packages or system dependencies -->
33-
<!-- Examples: -->
34-
<!-- Use build_depend for packages you need at compile time: -->
35-
<!-- <build_depend>message_generation</build_depend> -->
36-
<!-- Use buildtool_depend for build tool packages: -->
37-
<!-- <buildtool_depend>catkin</buildtool_depend> -->
38-
<!-- Use run_depend for packages you need at runtime: -->
39-
<!-- <run_depend>message_runtime</run_depend> -->
40-
<!-- Use test_depend for packages you need only for testing: -->
41-
<!-- <test_depend>gtest</test_depend> -->
5+
<description>
6+
Package for turtlebot3 automatic_parking. You need a reflective tape and real robots.
7+
You can see parking spot using this pacakge on rviz.
8+
</description>
9+
<license>Apache License 2.0</license>
10+
<author email="[email protected]">Gilbert</author>
11+
<maintainer email="[email protected]">Pyo</maintainer>
12+
<url type="bugtracker">https://github.com/ROBOTIS-GIT/turtlebot3_applications/issues</url>
13+
<url type="repository">https://github.com/ROBOTIS-GIT/turtlebot3_applications</url>
14+
<url type="website">http://turtlebot3.robotis.com</url>
4215
<buildtool_depend>catkin</buildtool_depend>
4316
<build_depend>rospy</build_depend>
4417
<build_depend>sensor_msgs</build_depend>
@@ -50,11 +23,4 @@
5023
<run_depend>rospy</run_depend>
5124
<run_depend>sensor_msgs</run_depend>
5225
<run_depend>std_msgs</run_depend>
53-
54-
55-
<!-- The export tag contains other, unspecified, tags -->
56-
<export>
57-
<!-- Other tools can request additional information be placed here -->
58-
59-
</export>
6026
</package>
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
Panels:
2+
- Class: rviz/Displays
3+
Help Height: 78
4+
Name: Displays
5+
Property Tree Widget:
6+
Expanded:
7+
- /Global Options1
8+
- /Status1
9+
Splitter Ratio: 0.5
10+
Tree Height: 775
11+
- Class: rviz/Selection
12+
Name: Selection
13+
- Class: rviz/Tool Properties
14+
Expanded:
15+
- /2D Pose Estimate1
16+
- /2D Nav Goal1
17+
- /Publish Point1
18+
Name: Tool Properties
19+
Splitter Ratio: 0.588679016
20+
- Class: rviz/Views
21+
Expanded:
22+
- /Current View1
23+
Name: Views
24+
Splitter Ratio: 0.5
25+
- Class: rviz/Time
26+
Experimental: false
27+
Name: Time
28+
SyncMode: 0
29+
SyncSource: LaserScan
30+
Visualization Manager:
31+
Class: ""
32+
Displays:
33+
- Alpha: 0.5
34+
Cell Size: 1
35+
Class: rviz/Grid
36+
Color: 160; 160; 164
37+
Enabled: true
38+
Line Style:
39+
Line Width: 0.0299999993
40+
Value: Lines
41+
Name: Grid
42+
Normal Cell Count: 0
43+
Offset:
44+
X: 0
45+
Y: 0
46+
Z: 0
47+
Plane: XY
48+
Plane Cell Count: 10
49+
Reference Frame: <Fixed Frame>
50+
Value: true
51+
- Alpha: 1
52+
Class: rviz/RobotModel
53+
Collision Enabled: false
54+
Enabled: true
55+
Links:
56+
All Links Enabled: true
57+
Expand Joint Details: false
58+
Expand Link Details: false
59+
Expand Tree: false
60+
Link Tree Style: Links in Alphabetic Order
61+
base_footprint:
62+
Alpha: 1
63+
Show Axes: false
64+
Show Trail: false
65+
base_link:
66+
Alpha: 1
67+
Show Axes: false
68+
Show Trail: false
69+
Value: true
70+
base_scan:
71+
Alpha: 1
72+
Show Axes: false
73+
Show Trail: false
74+
Value: true
75+
camera_depth_frame:
76+
Alpha: 1
77+
Show Axes: false
78+
Show Trail: false
79+
camera_depth_optical_frame:
80+
Alpha: 1
81+
Show Axes: false
82+
Show Trail: false
83+
camera_link:
84+
Alpha: 1
85+
Show Axes: false
86+
Show Trail: false
87+
Value: true
88+
camera_rgb_frame:
89+
Alpha: 1
90+
Show Axes: false
91+
Show Trail: false
92+
camera_rgb_optical_frame:
93+
Alpha: 1
94+
Show Axes: false
95+
Show Trail: false
96+
caster_back_left_link:
97+
Alpha: 1
98+
Show Axes: false
99+
Show Trail: false
100+
Value: true
101+
caster_back_right_link:
102+
Alpha: 1
103+
Show Axes: false
104+
Show Trail: false
105+
Value: true
106+
imu_link:
107+
Alpha: 1
108+
Show Axes: false
109+
Show Trail: false
110+
wheel_left_link:
111+
Alpha: 1
112+
Show Axes: false
113+
Show Trail: false
114+
Value: true
115+
wheel_right_link:
116+
Alpha: 1
117+
Show Axes: false
118+
Show Trail: false
119+
Value: true
120+
Name: RobotModel
121+
Robot Description: robot_description
122+
TF Prefix: ""
123+
Update Interval: 0
124+
Value: true
125+
Visual Enabled: true
126+
- Alpha: 1
127+
Autocompute Intensity Bounds: true
128+
Autocompute Value Bounds:
129+
Max Value: 10
130+
Min Value: -10
131+
Value: true
132+
Axis: Z
133+
Channel Name: intensity
134+
Class: rviz/LaserScan
135+
Color: 255; 255; 255
136+
Color Transformer: Intensity
137+
Decay Time: 0
138+
Enabled: true
139+
Invert Rainbow: false
140+
Max Color: 255; 255; 255
141+
Max Intensity: 22776
142+
Min Color: 0; 0; 0
143+
Min Intensity: 54
144+
Name: LaserScan
145+
Position Transformer: XYZ
146+
Queue Size: 10
147+
Selectable: true
148+
Size (Pixels): 3
149+
Size (m): 0.00999999978
150+
Style: Flat Squares
151+
Topic: /scan
152+
Unreliable: false
153+
Use Fixed Frame: true
154+
Use rainbow: true
155+
Value: true
156+
Enabled: true
157+
Global Options:
158+
Background Color: 48; 48; 48
159+
Fixed Frame: odom
160+
Frame Rate: 30
161+
Name: root
162+
Tools:
163+
- Class: rviz/Interact
164+
Hide Inactive Objects: true
165+
- Class: rviz/MoveCamera
166+
- Class: rviz/Select
167+
- Class: rviz/FocusCamera
168+
- Class: rviz/Measure
169+
- Class: rviz/SetInitialPose
170+
Topic: /initialpose
171+
- Class: rviz/SetGoal
172+
Topic: /move_base_simple/goal
173+
- Class: rviz/PublishPoint
174+
Single click: true
175+
Topic: /clicked_point
176+
Value: true
177+
Views:
178+
Current:
179+
Class: rviz/Orbit
180+
Distance: 10
181+
Enable Stereo Rendering:
182+
Stereo Eye Separation: 0.0599999987
183+
Stereo Focal Distance: 1
184+
Swap Stereo Eyes: false
185+
Value: false
186+
Focal Point:
187+
X: 0
188+
Y: 0
189+
Z: 0
190+
Focal Shape Fixed Size: true
191+
Focal Shape Size: 0.0500000007
192+
Invert Z Axis: false
193+
Name: Current View
194+
Near Clip Distance: 0.00999999978
195+
Pitch: 0.870398045
196+
Target Frame: <Fixed Frame>
197+
Value: Orbit (rviz)
198+
Yaw: 0.690397978
199+
Saved: ~
200+
Window Geometry:
201+
Displays:
202+
collapsed: false
203+
Height: 1056
204+
Hide Left Dock: false
205+
Hide Right Dock: false
206+
QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006400fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000dd00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000396fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000002800000396000000b000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000004ba0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
207+
Selection:
208+
collapsed: false
209+
Time:
210+
collapsed: false
211+
Tool Properties:
212+
collapsed: false
213+
Views:
214+
collapsed: false
215+
Width: 1855
216+
X: 65
217+
Y: 24

turtlebot3_automatic_parking/src/automatic_parking.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*******************************************************************************
2+
* Copyright 2016 ROBOTIS CO., LTD.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*******************************************************************************/
16+
17+
/* Authors: Gilbert */
18+
19+
120
#!/usr/bin/env python
221
import rospy
322
import sys
@@ -96,7 +115,7 @@ def finding_spot_position():
96115
end_angle_distance = get_angle_distance(spot_angle.data_3)
97116

98117
if start_angle_distance[1] != 0 and center_angle_distance[1] != 0 and end_angle_distance[1] != 0:
99-
print("calibration.....")
118+
print("calibration......")
100119
start_point = get_point(start_angle_distance)
101120
center_point = get_point(center_angle_distance)
102121
end_point = get_point(end_angle_distance)
@@ -223,4 +242,4 @@ def scan_spot_filter(msg):
223242
cmd_pub.publish(twist)
224243
sys.exit()
225244
cmd_pub.publish(twist)
226-
scan_spot_filter(msg)
245+
scan_spot_filter(msg)

0 commit comments

Comments
 (0)