Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aaron Moate
emulab-devel
Commits
234c0e19
Commit
234c0e19
authored
18 years ago
by
Timothy Stack
Browse files
Options
Downloads
Patches
Plain Diff
Comments
parent
072a1fd7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
robots/primotion/pilotClient.cc
+14
-1
14 additions, 1 deletion
robots/primotion/pilotClient.cc
robots/primotion/wheelManager.cc
+15
-1
15 additions, 1 deletion
robots/primotion/wheelManager.cc
with
29 additions
and
2 deletions
robots/primotion/pilotClient.cc
+
14
−
1
View file @
234c0e19
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2005 University of Utah and the Flux Group.
* Copyright (c) 2005
, 2006
University of Utah and the Flux Group.
* All rights reserved.
*/
...
...
@@ -212,6 +212,7 @@ bool pilotClient::handlePacket(mtp_packet_t *mp, list ¬ify_list)
}
}
/* Figure out if they want us to do a move or a pivot. */
if
((
mcg
->
position
.
x
!=
0.0
)
||
(
mcg
->
position
.
y
!=
0.0
))
{
acpValue
av
;
float
theta
;
...
...
@@ -331,6 +332,7 @@ bool pilotClient::handlePacket(mtp_packet_t *mp, list ¬ify_list)
mgt
=
this
->
pc_dashboard
.
getTelemetry
();
/* Compute "contacts" based on the sensor reports. */
if
((
mgt
->
front_ranger_left
!=
0.0
)
&&
(
mgt
->
front_ranger_right
!=
0.0
))
{
float
min_range
;
...
...
@@ -344,6 +346,10 @@ bool pilotClient::handlePacket(mtp_packet_t *mp, list ¬ify_list)
count
+=
1
;
}
else
if
(
mgt
->
front_ranger_left
!=
0.0
)
{
/*
* The front sensors are angled out a bit, the 0.40 angle seems
* to work well enough.
*/
points
[
count
].
x
=
cos
(
0.40
)
*
mgt
->
front_ranger_left
;
points
[
count
].
y
=
sin
(
0.40
)
*
mgt
->
front_ranger_left
;
count
+=
1
;
...
...
@@ -379,6 +385,13 @@ bool pilotClient::handlePacket(mtp_packet_t *mp, list ¬ify_list)
count
+=
1
;
}
else
if
(
mgt
->
rear_ranger_left
!=
0.0
)
{
/*
* XXX This computation is probably wrong... We should have a
* constant offset for Y and set X to be the ranger value plus
* some constant. I don't remember exactly what the ranger
* value means for these (i.e. if it is based off the center
* of the robot or not).
*/
points
[
count
].
x
=
cos
(
M_PI
-
0.40
)
*
mgt
->
rear_ranger_left
;
points
[
count
].
y
=
sin
(
M_PI
-
0.40
)
*
mgt
->
rear_ranger_left
;
count
+=
1
;
...
...
This diff is collapsed.
Click to expand it.
robots/primotion/wheelManager.cc
+
15
−
1
View file @
234c0e19
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2005 University of Utah and the Flux Group.
* Copyright (c) 2005
, 2006
University of Utah and the Flux Group.
* All rights reserved.
*/
...
...
@@ -292,6 +292,7 @@ void wheelManager::setDestination(float x, float y, wmCallback *callback)
distance
=
-
distance
;
}
/* For small distances, drop the sensor thresholds so we can maneuver. */
if
(
distance
<=
0.60
f
)
tl
=
THRESH_LOW
;
else
...
...
@@ -303,7 +304,16 @@ void wheelManager::setDestination(float x, float y, wmCallback *callback)
mgt
=
this
->
wm_dashboard
->
getTelemetry
();
diff
=
fabsf
(
mgt
->
rear_ranger_left
-
mgt
->
rear_ranger_right
);
/*
* If the rear rangers detect an obstacle that is not perpendicular to the
* robot, we might need to pivot in the opposite direction so the tail
* doesn't hit the obstacle.
*/
if
(
diff
>
0.08
f
)
{
/*
* Make sure the direction we want to pivot is clear, otherwise, pivot
* the opposite direction.
*/
if
((
mgt
->
rear_ranger_right
==
0.0
f
)
||
(
mgt
->
rear_ranger_left
<
mgt
->
rear_ranger_right
))
{
if
(
angle
<
0.0
f
)
{
...
...
@@ -535,6 +545,10 @@ void wheelManager::motionFinished(acpObject *behavior,
}
this
->
wm_dashboard
->
endMove
(
left_odometer
,
right_odometer
);
/*
* If both wheels moved the same direction it was a straight move,
* otherwise, it was a pivot.
*/
if
((
left_odometer
/
fabsf
(
left_odometer
))
==
(
right_odometer
/
fabsf
(
right_odometer
)))
{
printf
(
" %f %f -- %f %f
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment