Revision cda6b590
change BOM constants to near actual value
scout/libscout/spawn_ems.sh | ||
---|---|---|
1 |
rosservice call /spawn_em 3.5 1.07 3.063053 "em_0" |
|
2 |
rosservice call /spawn_em 3.5 1.14 3.2201 "em_1" |
scout/scoutsim/src/emitter.cpp | ||
---|---|---|
127 | 127 |
path_dc.DrawLine( |
128 | 128 |
pos.x * PIX_PER_METER, |
129 | 129 |
pos.y * PIX_PER_METER, |
130 |
(pos.x+cos(orient-BOM_APERTURE/2)*BOM_DISTANCE)*PIX_PER_METER, |
|
131 |
(pos.y-sin(orient-BOM_APERTURE/2)*BOM_DISTANCE)*PIX_PER_METER); |
|
130 |
(pos.x+cos(orient-BOM_EM_APERTURE/2)* |
|
131 |
BOM_EM_DISTANCE)*PIX_PER_METER, |
|
132 |
(pos.y-sin(orient-BOM_EM_APERTURE/2)* |
|
133 |
BOM_EM_DISTANCE)*PIX_PER_METER); |
|
132 | 134 |
path_dc.DrawLine( |
133 | 135 |
pos.x * PIX_PER_METER, |
134 | 136 |
pos.y * PIX_PER_METER, |
135 |
(pos.x+cos(orient+BOM_APERTURE/2)*BOM_DISTANCE)*PIX_PER_METER, |
|
136 |
(pos.y-sin(orient+BOM_APERTURE/2)*BOM_DISTANCE)*PIX_PER_METER); |
|
137 |
(pos.x+cos(orient+BOM_EM_APERTURE/2)* |
|
138 |
BOM_EM_DISTANCE)*PIX_PER_METER, |
|
139 |
(pos.y-sin(orient+BOM_EM_APERTURE/2)* |
|
140 |
BOM_EM_DISTANCE)*PIX_PER_METER); |
|
137 | 141 |
|
138 | 142 |
|
139 | 143 |
path_dc.DrawCircle( |
140 |
wxPoint((pos.x+cos(orient-BOM_APERTURE/2)*BOM_DISTANCE)*PIX_PER_METER, |
|
141 |
(pos.y-sin(orient-BOM_APERTURE/2)*BOM_DISTANCE)*PIX_PER_METER) |
|
144 |
wxPoint((pos.x+cos(orient-BOM_EM_APERTURE/2)* |
|
145 |
BOM_EM_DISTANCE)*PIX_PER_METER, |
|
146 |
(pos.y-sin(orient-BOM_EM_APERTURE/2)* |
|
147 |
BOM_EM_DISTANCE)*PIX_PER_METER) |
|
142 | 148 |
,2); |
143 | 149 |
path_dc.DrawCircle( |
144 |
wxPoint((pos.x+cos(orient+BOM_APERTURE/2)*BOM_DISTANCE)*PIX_PER_METER, |
|
145 |
(pos.y-sin(orient+BOM_APERTURE/2)*BOM_DISTANCE)*PIX_PER_METER) |
|
150 |
wxPoint((pos.x+cos(orient+BOM_EM_APERTURE/2)* |
|
151 |
BOM_EM_DISTANCE)*PIX_PER_METER, |
|
152 |
(pos.y-sin(orient+BOM_EM_APERTURE/2)* |
|
153 |
BOM_EM_DISTANCE)*PIX_PER_METER) |
|
146 | 154 |
,2); |
147 | 155 |
} |
148 | 156 |
|
scout/scoutsim/src/emitter.h | ||
---|---|---|
24 | 24 |
// Distance, pixels, from center of robot to the linesensors. |
25 | 25 |
#define LNSNSR_D 20 |
26 | 26 |
|
27 |
#define BOM_APERTURE (PI / 3.0) |
|
28 |
#define BOM_DISTANCE 1.0 |
|
27 |
#define BOM_EM_APERTURE (PI * 0.05) // 9 degrees |
|
28 |
#define BOM_EM_DISTANCE 5.0 |
|
29 |
#define BOM_REC_APERTURE (PI / 6) // 30 degrees |
|
30 |
#define BOM_REC_DISTANCE 5.0 |
|
29 | 31 |
|
30 | 32 |
namespace scoutsim |
31 | 33 |
{ |
scout/scoutsim/src/sim_frame.cpp | ||
---|---|---|
144 | 144 |
teleop_scoutname = "scout1"; |
145 | 145 |
|
146 | 146 |
//Emitter default values |
147 |
em_aperture = PI / 3.0;
|
|
148 |
em_distance = 1.0;
|
|
147 |
em_aperture = BOM_EM_APERTURE;
|
|
148 |
em_distance = BOM_EM_DISTANCE;
|
|
149 | 149 |
|
150 | 150 |
|
151 | 151 |
teleop_pub = nh.advertise< ::messages::set_motors>("/scout1/set_motors", 1000); |
... | ... | |
797 | 797 |
emitter_pos = m_it->second->get_pos(); |
798 | 798 |
|
799 | 799 |
if(is_inrange(bom_pos, emitter_pos, em_aperture, em_distance) && |
800 |
is_inrange(emitter_pos, bom_pos, BOM_APERTURE, BOM_DISTANCE)) {
|
|
800 |
is_inrange(emitter_pos, bom_pos, BOM_REC_APERTURE, BOM_REC_DISTANCE)) {
|
|
801 | 801 |
string em_id_str = m_it->first.substr(m_it->first.find("_")+1); |
802 | 802 |
emitter_id = atoi(em_id_str.c_str()); |
803 | 803 |
return emitter_id; |
Also available in: Unified diff