@@ -341,7 +341,8 @@ def listGraphWaypoints(graphnav_client):
341341 graph , localization_id ) # THIS FUNCTION DOES THE PRINTING.
342342
343343
344- def navigateTo (conn , graphnav_client , goal , sleep = 0.5 , tolerance = None , speed = "medium" ):
344+ def navigateTo (conn , graphnav_client , goal , sleep = 0.5 , tolerance = None ,
345+ speed = "medium" , travel_params = None ):
345346 """
346347 Navigate to a pose in the seed frame (i.e. global pose).
347348 Calls the NavigateToAnchor service. Blocking call until
@@ -363,6 +364,7 @@ def navigateTo(conn, graphnav_client, goal, sleep=0.5, tolerance=None, speed="me
363364 the goal in x, y, z axes. Sets the 'goal_waypoint_rt_seed_ewrt_seed_tolerance'
364365 parameter. Applicable only for seed frame goals.
365366 speed (str): "medium", "slow", "fast", or "default".
367+ travel_params (TravelParams proto): Travel params for navigation. If provided, will override speed.
366368 probably don't need:
367369 +callback: function to be called per cycle+
368370 +callback_args+
@@ -393,15 +395,15 @@ def navigateTo(conn, graphnav_client, goal, sleep=0.5, tolerance=None, speed="me
393395 if tolerance is not None :
394396 goal_waypoint_rt_seed_ewrt_seed_tolerance = Vec3 (x = tolerance [0 ], y = tolerance [1 ], z = tolerance [2 ])
395397
396- travel_params = None
397- if speed not in {"default" , "medium" , "slow" , "fast" }:
398- raise ValueError ("Invalid speed for navigation:" , speed )
399- if speed == "slow" :
400- travel_params = graph_nav_pb2 .TravelParams (velocity_limit = NAV_VELOCITY_LIMITS_SLOW )
401- elif speed == "medium" :
402- travel_params = graph_nav_pb2 .TravelParams (velocity_limit = NAV_VELOCITY_LIMITS_MEDIUM )
403- elif speed == "fast" :
404- travel_params = graph_nav_pb2 .TravelParams (velocity_limit = NAV_VELOCITY_LIMITS_FAST )
398+ if travel_params is None :
399+ if speed not in {"default" , "medium" , "slow" , "fast" }:
400+ raise ValueError ("Invalid speed for navigation:" , speed )
401+ if speed == "slow" :
402+ travel_params = graph_nav_pb2 .TravelParams (velocity_limit = NAV_VELOCITY_LIMITS_SLOW )
403+ elif speed == "medium" :
404+ travel_params = graph_nav_pb2 .TravelParams (velocity_limit = NAV_VELOCITY_LIMITS_MEDIUM )
405+ elif speed == "fast" :
406+ travel_params = graph_nav_pb2 .TravelParams (velocity_limit = NAV_VELOCITY_LIMITS_FAST )
405407
406408 nav_to_cmd_id = None
407409 is_finished = False
0 commit comments