Overview | API
Namespace : AL
#include <alproxies/alnavigationproxy.h>
As any module, this module inherits methods from ALModule API. It also has the following specific methods:
With Pepper, you can use generic navigation methods:
Deprecated methods
Deprecated events
There are two overloads of this function:
Makes the robot navigate to a relative metrical target pose2D expressed in FRAME_ROBOT. The robot computes a path to avoid obstacles.
The robot is likely to perform any safety action to ensure the non collision with the environment. For example look with the head, stop to replan a new path. Thus, no motion timeline that takes the head resource can be run during a navigateTo.
Unlike ALMotionProxy::moveTo(), the robot can choose its own path and speed while moving around. The speed decreases the closer the robot gets to obstacles. If the obstacle avoidance becomes too dangerous (as soon as it has detected an obstacle in its security area) the robot stops like in ALNavigationProxy::moveTo().
The target must be closer than 3m from the robot, otherwise the command will be ignored and a warning will be prompted.
This is a blocking call.
Parameters: |
|
---|---|
Returns: | True if the robot reached its target at the end or False if it has been stopped by obstacles or if it cannot find a path to the target. |
navigationProxy.navigateTo(2.0, 0.0)
Parameters: |
|
---|---|
Returns: | True if the robot reached its target at the end or False if it has been stopped by obstacles or if it cannot find a path to the target. |
navigationProxy.navigateTo(2.0, 0.0, [["SpeedFactor", 0.5]])
Parameters: |
|
---|---|
Returns: | True when the robot executed the trajectory completely, and also when it has been definitely stopped by obstacles. |
The following command makes the robot move 1 m forward in 5 s, then 1 m backward in 10 s, without pausing:
navigationProxy.moveAlong(["Composed", ["Holonomic", ["Line", [1.0, 0.0]], 0.0, 5.0], ["Holonomic", ["Line", [-1.0, 0.0]], 0.0, 10.0]])
Looks for a free circular zone of a specified radius not farer than a specified displacement. To do this the robot moves and looks around itself. This is a blocking call.
Parameters: |
|
---|---|
Returns: | an ALValue [Free Zone Error Code, result radius (meters), [worldMotionToRobotCenterX (meters), worldMotionToRobotCenterY (meters)]] |
desiredRadius = 0.6
displacementConstraint = 0.5
navigationProxy.findFreeZone(desiredRadius, displacementConstraint)
Starts a loop to update the mapping of the free space around the robot. It is like ALNavigationProxy::findFreeZone() but this time the user is responsible for the move of scanning. It is a non-blocking call. Call ALNavigationProxy::stopAndComputeFreeZone() to get the result. The maximum time for the scanning is 60 seconds. After that the update is stopped automatically. Clears the map if called again.
Stops the update and returns the result. If the update was not running it returns error code 1.
Parameters: |
|
---|---|
Returns: | an ALValue [Free Zone Error Code, result radius (meters), [worldMotionToRobotCenterX (meters), worldMotionToRobotCenterY (meters)]] |
The following command makes the robot move to the center of the free zone if everything went OK.
# -*- encoding: UTF-8 -*-
from naoqi import ALProxy
import almath
import argparse
import math
def main(robotIP, PORT = 9559):
navigationProxy = ALProxy("ALNavigation", robotIP, PORT)
motionProxy = ALProxy("ALMotion", robotIP, PORT)
postureProxy = ALProxy("ALRobotPosture", robotIP, PORT)
# Wake up robot
motionProxy.wakeUp()
# Send robot to Stand Init
postureProxy.goToPosture("StandInit", 0.5)
# Scanning the environement.
navigationProxy.startFreeZoneUpdate()
###########################################################################
# Add here an animation with timelines and moves (less than 60 seconds). #
# For example :
motionProxy.moveTo(0.0, 0.0, 2.0 * math.pi)
###########################################################################
desiredRadius = 0.6
displacementConstraint = 0.5
result = navigationProxy.findFreeZone(desiredRadius, displacementConstraint)
errorCode = result[0]
if errorCode != 1:
worldToCenterFreeZone = almath.Pose2D(result[2][0], result[2][1], 0.0)
worldToRobot = almath.Pose2D(motionProxy.getRobotPosition(True))
robotToFreeZoneCenter = almath.pinv(worldToRobot) * worldToCenterFreeZone
motionProxy.moveTo(robotToFreeZoneCenter.x, robotToFreeZoneCenter.y, 0.0)
else :
print "Problem during the update of the free zone."
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--ip", type=str, default="127.0.0.1",
help="Robot ip address")
parser.add_argument("--port", type=int, default=9559,
help="Robot port number")
args = parser.parse_args()
main(args.ip, args.port)
Deprecated since version 1.22: Use ALMotionProxy::setOrthogonalSecurityDistance() instead.
Defines the security distance used by ALNavigationProxy::moveTo().
Parameters: |
|
---|
Deprecated since version 1.22: Use ALMotionProxy::getOrthogonalSecurityDistance() instead.
Gets the current security distance used by ALNavigationProxy::moveTo() to check dangerous obstacles.
Returns: | distance in meters between any part of the robot and any obstacle in the direction of the motion. It defines the security area in which any obstacle detection stops the robot. Default value: 0.4m. |
---|
Deprecated since version 1.22: Use ALMotionProxy::move() instead.
Warning
If you still use this deprecated method, make sure you activate ALMotionProxy::setExternalCollisionProtectionEnabled() first.
There are two overloads of this function:
Like ALMotionProxy::move(), makes the robot move at the given velocity, expressed in FRAME_ROBOT. Unlike ALMotionProxy::move(), the robot stops as soon as it has detected an obstacle in its security area. This is a non-blocking call.
Parameters: |
|
---|
Deprecated since version 1.22: Use ALMotionProxy::move() instead.
Warning
If you still use this deprecated method, make sure you activate ALMotionProxy::setExternalCollisionProtectionEnabled() first.
Like ALMotionProxy::move(), makes the robot move at the given velocity, expressed in FRAME_ROBOT, with a move configuration. Unlike ALMotionProxy::move(), the robot stops as soon as it has detected an obstacle in its security area. This is a non-blocking call.
Parameters: |
|
---|
Deprecated since version 1.22: Use ALMotionProxy::moveToward() instead.
Warning
If you still use this deprecated method, make sure you activate ALMotionProxy::setExternalCollisionProtectionEnabled() first.
There are two overloads of this function:
Like ALMotionProxy::moveToward(), makes the robot move at the given normalized velocity, expressed in FRAME_ROBOT. Unlike ALMotionProxy::moveToward(), the robot stops as soon as it has detected an obstacle in its security area. This is a non-blocking call.
Parameters: |
|
---|
Deprecated since version 1.22: Use ALMotionProxy::moveToward() instead.
Warning
If you still use this deprecated method, make sure you activate ALMotionProxy::setExternalCollisionProtectionEnabled() first.
Like ALMotionProxy::moveToward(), makes the robot move at the given normalized velocity, expressed in FRAME_ROBOT, with a move configuration. Unlike ALMotionProxy::moveToward(), the robot stops as soon as it has detected an obstacle in its security area. This is a non-blocking call.
Parameters: |
|
---|
Deprecated since version 1.22: Use ALMotionProxy::moveTo() instead.
Warning
If you still use this deprecated method, make sure you activate ALMotionProxy::setExternalCollisionProtectionEnabled() first.
There are two overloads of this function:
Like ALMotionProxy::moveTo(), makes the robot move to the given pose (i.e. location + orientation). in the ground plane, relative to FRAME_ROBOT. Unlike ALMotionProxy::moveTo(), the robot stops as soon as it has detected an obstacle in its security area. This is a blocking call.
For now bumpers and sonars are used to detect obstacles.
Parameters: |
|
---|---|
Returns: | True if the robot reached the target, False if the robot was stopped by an obstacle. |
Deprecated since version 1.22: Use ALMotionProxy::moveTo() instead.
Warning
If you still use this deprecated method, make sure you activate ALMotionProxy::setExternalCollisionProtectionEnabled() first.
Like ALMotionProxy::moveTo(), makes the robot move to the given pose (i.e. location + orientation) in the ground plane, relative to FRAME_ROBOT, with custom move configuration. Unlike ALMotionProxy::moveTo(), the robot stops as soon as it has detected an obstacle in its security area. This is a blocking call.
For now bumpers and sonars are used to detect obstacles.
Parameters: |
|
---|---|
Returns: | True if the robot reached the target, False if the robot was stopped by an obstacle. |
Raised when status of the local navigator changes.
Parameters: |
|
---|
Raised when an obstacle is detected in the close area.
Parameters: |
|
---|
Raised when the robot starts or stops a motion to leave an obstacle neighbourhood.
Parameters: |
|
---|
Raised when the trajectory progress is updated.
Parameters: |
|
---|
Raised when the required target is unreachable because it is inside an obstacle.
The robot then computes the closest target to the initial one.
Parameters: |
|
---|
Deprecated since version 1.22: use ALMotion/Safety/MoveFailed() instead.
Raised when status of the Safe navigator changes.
Parameters: |
|
---|
Deprecated since version 1.22: use ALMotion/Safety/MoveFailed() instead.
Raised when there is an obstacle preventing the robot from starting its motion.
Deprecated since version 1.22: use ALMotion/Safety/MoveFailed() instead.
Raised when robot is already at its target.
Deprecated since version 1.22: use ALMotion/Safety/MoveFailed() instead.
Use ALMotion/Safety/MoveFailed() instead.
Raised when an obstacle is detected in the security area.
Parameters: |
|
---|
Error code | meanning |
---|---|
0 | OK. You can trust the result center and radius, and asked constraints were respected. |
1 | KO. There was a problem, do not take into account the returned center and radius. |
2 | CONSTRAINT KO. There was no problem but the asked constraints are not fullfilled, returned best approching solution |
Enter search terms or a module, class or function name.