-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement status control, wait for movement completion (movj/movl)
See #106
- Loading branch information
1 parent
45b4309
commit afd870f
Showing
4 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
libraries/TeoYarp/AmorCartesianControl/AmorCartesianControl.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- | ||
|
||
#include "AmorCartesianControl.hpp" | ||
|
||
#include <yarp/os/Time.h> | ||
|
||
#include <ColorDebug.hpp> | ||
|
||
bool roboticslab::AmorCartesianControl::waitForCompletion(int vocab) | ||
{ | ||
currentState = vocab; | ||
|
||
AMOR_RESULT res; | ||
amor_movement_status status; | ||
|
||
do | ||
{ | ||
res = amor_get_movement_status(handle, &status); | ||
|
||
if (res == AMOR_FAILED) | ||
{ | ||
CD_ERROR("%s\n", amor_error()); | ||
break; | ||
} | ||
|
||
yarp::os::Time::delay(0.5); // seconds | ||
} | ||
while (status != AMOR_MOVEMENT_STATUS_FINISHED); | ||
|
||
currentState = VOCAB_CC_NOT_CONTROLLING; | ||
|
||
return res == AMOR_SUCCESS; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters