Guide local goals around observed obstacles and finish native recovery
This commit is contained in:
@@ -39,7 +39,8 @@ def observed_turn_support(angle, terrain, pose, monitor, contact_height):
|
||||
return bool(np.all(states=='observed-supported'))
|
||||
|
||||
|
||||
def alignment_angle(pose, goal, terrain, detected, monitor, contact_height):
|
||||
def alignment_angle(pose, goal, terrain, detected, monitor, contact_height, *,
|
||||
collision_terrain=None):
|
||||
delta = np.asarray(goal[:2]) - np.asarray(pose[:2])
|
||||
if np.linalg.norm(delta) <= .4:
|
||||
return None
|
||||
@@ -49,8 +50,13 @@ def alignment_angle(pose, goal, terrain, detected, monitor, contact_height):
|
||||
angle = math.atan2(math.sin(bearing), math.cos(bearing))
|
||||
if abs(angle) < math.pi/6:
|
||||
return None
|
||||
if not monitor.rotation_clear(angle, terrain, pose):
|
||||
collision = terrain if collision_terrain is None else collision_terrain
|
||||
if not monitor.rotation_clear(angle, collision, pose):
|
||||
return None
|
||||
if collision_terrain is not None:
|
||||
forbidden = terrain[terrain[:, 3] > collision[:, 3]]
|
||||
if not monitor.ground_envelope().rotation_clear(angle, forbidden, pose):
|
||||
return None
|
||||
objects = DetectionObstacles(monitor)
|
||||
hazards = np.column_stack((detected, np.full(len(detected), objects.cost)))
|
||||
if not objects.monitor.rotation_clear(angle, hazards, pose):
|
||||
|
||||
Reference in New Issue
Block a user