Skip to content
Snippets Groups Projects
Commit 913d2ccb authored by Christian Dreher's avatar Christian Dreher
Browse files

fix: Minor Adjustments to client API.

parent 21beb5bc
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,7 @@ exns::ExampleClient::exampleNavigation()
// Create an example configuration valid for the following move* calls.
navigator.configure(NavigationStackConfig()
.configureGeneral({}));
.configureGeneral({}/*{.maxVel = VelocityLimits{.linear = 400 , .angular = 0.1}}*/));
// Example of registering a lambda as callback.
navigator.onGoalReached([&]()
......@@ -105,8 +105,8 @@ exns::ExampleClient::exampleNavigation()
const Pose goal = Pose::Identity();
navigator.moveTo(goal, NavigationFrame::Absolute);
// Wait until goal is reached (or timeout is reached);
navigator.waitForGoalReached(5min);
// Wait until goal is reached
navigator.waitForGoalReached();
std::this_thread::sleep_for(2s);
......
......@@ -96,29 +96,25 @@ armarx::nav::client::Navigator::onWaypointNearlyReached(std::function<void(int)>
}
void
armarx::nav::client::Navigator::waitForGoalReached(std::chrono::milliseconds timeout)
auto armarx::nav::client::Navigator::waitForGoalReached() -> GoalReachedWaitResult
{
return {};
}
void
armarx::nav::client::Navigator::waitForGoalNearlyReached(std::chrono::milliseconds timeout)
auto armarx::nav::client::Navigator::waitForGoalNearlyReached() -> GoalReachedWaitResult
{
return {};
}
void
armarx::nav::client::Navigator::waitForWaypointReached(std::chrono::milliseconds timeout, int waypointIndex)
auto armarx::nav::client::Navigator::waitForWaypointReached() -> WaypointReachedWaitResult
{
return {};
}
void
armarx::nav::client::Navigator::waitForWaypointNearlyReached(std::chrono::milliseconds timeout, int waypointIndex)
auto armarx::nav::client::Navigator::waitForWaypointNearlyReached() -> WaypointReachedWaitResult
{
return {};
}
......@@ -22,7 +22,6 @@
// STD/STL
#include <chrono>
#include <functional>
#include <string>
#include <vector>
......@@ -63,13 +62,30 @@ namespace armarx::nav::client
void onWaypointNearlyReached(std::function<void(int)> callback);
void waitForGoalReached(std::chrono::milliseconds timeout);
enum class Status
{
Success,
Failure
};
void waitForGoalNearlyReached(std::chrono::milliseconds timeout);
struct GoalReachedWaitResult
{
Status status;
};
void waitForWaypointReached(std::chrono::milliseconds timeout, int waypointIndex);
GoalReachedWaitResult waitForGoalReached();
void waitForWaypointNearlyReached(std::chrono::milliseconds timeout, int waypointIndex);
GoalReachedWaitResult waitForGoalNearlyReached();
struct WaypointReachedWaitResult
{
Status status;
int waypointIndex;
};
WaypointReachedWaitResult waitForWaypointReached();
WaypointReachedWaitResult waitForWaypointNearlyReached();
protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment