Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
1a904fa6
Commit
1a904fa6
authored
Feb 02, 2005
by
Timothy Stack
Browse files
Add a contact point to the contact-report when the robot stalls
parent
2a8068fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
robots/primotion/pilotClient.cc
View file @
1a904fa6
...
...
@@ -55,6 +55,8 @@ void pilotMoveCallback::call(int status)
mtp_packet_t
mp
;
mtp_status_t
ms
;
fprintf
(
stderr
,
"callback: %d
\n
"
,
status
);
switch
(
status
)
{
case
aGARCIA_ERRFLAG_NORMAL
:
ms
=
MTP_POSITION_STATUS_COMPLETE
;
...
...
@@ -316,6 +318,11 @@ bool pilotClient::handlePacket(mtp_packet_t *mp, list ¬ify_list)
points
[
count
].
y
=
sin
(
-
M_PI
+
0.40
)
*
mgt
->
rear_ranger_right
;
count
+=
1
;
}
else
if
(
mgt
->
stall_contact
&&
count
==
0
)
{
points
[
count
].
x
=
(
mgt
->
stall_contact
<
0
)
?
-
0.20
:
0.15
;
points
[
count
].
y
=
0
;
count
+=
1
;
}
mtp_init_packet
(
&
cmp
,
MA_Opcode
,
MTP_CONTACT_REPORT
,
...
...
robots/primotion/wheelManager.cc
View file @
1a904fa6
...
...
@@ -149,7 +149,9 @@ aErr endCallback::call()
status
=
this
->
ec_behavior
->
getNamedValue
(
"completion-status"
)
->
getIntVal
();
this
->
ec_wheel_manager
.
motionFinished
(
status
,
this
->
ec_callback
);
this
->
ec_wheel_manager
.
motionFinished
(
this
->
ec_behavior
,
status
,
this
->
ec_callback
);
this
->
ec_callback
=
NULL
;
...
...
@@ -321,11 +323,23 @@ void wheelManager::motionStarted(void)
this
->
wm_dashboard
->
startMove
(
this
->
wm_garcia
);
}
void
wheelManager
::
motionFinished
(
int
status
,
wmCallback
*
callback
)
void
wheelManager
::
motionFinished
(
acpObject
*
behavior
,
int
status
,
wmCallback
*
callback
)
{
if
(
debug
)
{
fprintf
(
stderr
,
"debug: motion finished -- %d
\n
"
,
status
);
}
if
(
status
==
aGARCIA_ERRFLAG_STALL
)
{
float
distance
=
behavior
->
getNamedValue
(
"distance"
)
->
getFloatVal
();
this
->
wm_dashboard
->
getTelemetry
()
->
stall_contact
=
(
distance
<
0
)
?
-
1
:
1
;
}
else
{
this
->
wm_dashboard
->
getTelemetry
()
->
stall_contact
=
0
;
}
if
(
status
!=
aGARCIA_ERRFLAG_WONTEXECUTE
)
{
if
((
status
!=
aGARCIA_ERRFLAG_NORMAL
)
&&
...
...
robots/primotion/wheelManager.hh
View file @
1a904fa6
...
...
@@ -161,7 +161,7 @@ public:
* values.)
* @param callback The callback to trigger.
*/
void
motionFinished
(
int
status
,
wmCallback
*
callback
);
void
motionFinished
(
acpObject
*
behavior
,
int
status
,
wmCallback
*
callback
);
/**
* Check the object to make sure it is internally consistent.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment