Skip to content

Commit

Permalink
[SW-743] Add mutate_world_objects functionality to spot_wrapper (#87)
Browse files Browse the repository at this point in the history
This allows the user to mutate Spot's world objects. Specifically, it can be used to create/delete no-go regions for Spot which are implemented as new world objects. 

I have been testing this in conjunction with a [follow-up PR](bdaiinstitute/spot_ros2#271) to integrate this into Spot ROS 2. With this implementation, Spot is successfully able to receive and respond to mutate world object requests.
  • Loading branch information
khughes-bdai authored Feb 21, 2024
1 parent 676baf8 commit aeb9ab1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spot_wrapper/spot_world_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
import logging
import typing

from bosdyn.api.world_object_pb2 import ListWorldObjectResponse, WorldObjectType
from bosdyn.api.world_object_pb2 import (
ListWorldObjectResponse,
MutateWorldObjectRequest,
MutateWorldObjectResponse,
WorldObjectType,
)
from bosdyn.client.async_tasks import AsyncPeriodicQuery
from bosdyn.client.common import FutureWrapper
from bosdyn.client.world_object import WorldObjectClient
Expand Down Expand Up @@ -92,3 +97,6 @@ def list_world_objects(
"""
return self._world_objects_client.list_world_objects(object_types, time_start_point)

def mutate_world_objects(self, request: MutateWorldObjectRequest) -> MutateWorldObjectResponse:
return self._world_objects_client.mutate_world_objects(request)
5 changes: 5 additions & 0 deletions spot_wrapper/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,3 +1477,8 @@ def choreography_log_to_animation_file(
return self._spot_dance.choreography_log_to_animation_file(name, fpath, has_arm, **kwargs)
else:
return False, "Spot is not licensed for choreography", ""

def mutate_world_objects(
self, mutate_request: world_object_pb2.MutateWorldObjectRequest
) -> world_object_pb2.MutateWorldObjectResponse:
return self._spot_world_objects.mutate_world_objects(mutate_request)

0 comments on commit aeb9ab1

Please sign in to comment.