Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path workaround for navigation into the laboratory #8

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion modules/r1Obr-orchestrator/nav2loc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ bool Nav2Loc::go(string loc)
if (loc == "home")
return goHome();

// This piece of code will work with a specific locations.ini configuration
// Forcing a specific path following if we want to go to the laboratory from outside
if(loc == "laboratory")
{
if(!m_iNav2D->checkInsideArea("laboratory_area"))
{
if(!m_iNav2D->gotoTargetByLocationName("laboratory_path"))
{
yCError(NAV_2_LOC, "Error with navigation to lab area from outside");
return false;
}
}
// If we are inside the lab area, we swap to the default behaviour
}

if(!m_iNav2D->gotoTargetByLocationName(loc))
{
yCError(NAV_2_LOC, "Error with navigation to home location");
Expand Down Expand Up @@ -177,4 +192,4 @@ bool Nav2Loc::isNavigationAborted()
string Nav2Loc::getCurrentTarget()
{
return m_current_target_location;
}
}