-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobot.inc
70 lines (62 loc) · 1.63 KB
/
robot.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# robot.inc
# model for the robot "Robot"
# Author: Sindiso Mkhatshwa
# Date: 10 - 09 - 2020
#--------------------------------------------------------------------------
#code
#--------------------------------------------------------------------------
define robot_sonar sensor
(
# transducer size [xsize ysize zsize] in meters
size [0.01 0.05 0.01 ]
# range bounds [min max]
range [0.3 2.0]
# angular field of view in degrees
fov 10
# color that ranges are drawn in the gui
color_rgba [ 1 0 0 1]
# how many rays in a beam
samples 180
)
define robot_sonars ranger
(
# one line for each sonar [xpos ypos zpos heading]
robot_sonar( pose [ 0.25 0.125 0 0]) #sonar infront,left
robot_sonar( pose [ 0.25 -0.125 0 0]) #sonar infront,right
robot_sonar( pose [ 0.125 0.25 0 30]) #sonar on left corner
robot_sonar( pose [ 0.125 -0.25 0 -30]) #sonar on right corner
robot_sonar( pose [ -0.25 0 0 -180]) #sonar at the back
)
define robot_blobfinder blobfinder
(
colors_count 2
colors ["black" "amber"] # color of an oil spill
image [160 120] # resolution
range 9.00 # meters
fov 60 # field of view
)
#put everything together
define robot position
(
# actual size of the robot
size [0.5 0.5 0.5]
# centre of rotation offset
origin [0 0 0 0]
# specify the shape of the robot
block
(
points 6
point[5] [0 0]
point[4] [0 0.5]
point[3] [0.375 0.5]
point[2] [0.5 0.375]
point[1] [0.5 0.125]
point[0] [0.375 0]
z [0 0.5]
)
#how is the robot driven
drive "diff"
#attach sensors to robot
robot_sonars( )
robot_blobfinder( )
)