Skip to content

Commit fd5af88

Browse files
authored
RSDK-6609 - Change implementation of MoveOnMap to include obstacles (#539)
1 parent 5736d37 commit fd5af88

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/viam/services/motion/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
from typing import Any, Final, List, Mapping, Optional, Sequence
1+
from typing import Any, Final, List, Mapping, Optional, Sequence, Iterable
22

33
from grpclib.client import Channel
44

55
from viam.proto.common import (
66
DoCommandRequest,
77
DoCommandResponse,
8+
Geometry,
89
GeoObstacle,
910
GeoPoint,
1011
Pose,
@@ -171,6 +172,7 @@ async def move_on_map(
171172
destination: Pose,
172173
slam_service_name: ResourceName,
173174
configuration: Optional[MotionConfiguration] = None,
175+
obstacles: Optional[Iterable[Geometry]] = None,
174176
*,
175177
extra: Optional[Mapping[str, ValueTypes]] = None,
176178
timeout: Optional[float] = None,
@@ -199,6 +201,7 @@ async def move_on_map(
199201
plan_deviation_m (float): The distance in meters that the machine can deviate from the motion plan.
200202
linear_m_per_sec (float): Linear velocity this machine should target when moving.
201203
angular_degs_per_sec (float): Angular velocity this machine should target when turning.
204+
obstacles (Optional[Iterable[Geometry]]): Obstacles to be considered for motion planning.
202205
extra (Optional[Dict[str, Any]]): Extra options to pass to the underlying RPC call.
203206
timeout (Optional[float]): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying
204207
RPC call.
@@ -214,6 +217,7 @@ async def move_on_map(
214217
component_name=component_name,
215218
slam_service_name=slam_service_name,
216219
motion_configuration=configuration,
220+
obstacles=obstacles,
217221
extra=dict_to_struct(extra),
218222
)
219223
response: MoveOnMapResponse = await self.client.MoveOnMap(request, timeout=timeout)

tests/mocks/services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ async def MoveOnMap(self, stream: Stream[MoveOnMapRequest, MoveOnMapResponse]) -
488488
self.destination = request.destination
489489
self.slam_service = request.slam_service_name
490490
self.configuration = request.motion_configuration
491+
self.obstacles = request.obstacles
491492
self.extra = struct_to_dict(request.extra)
492493
self.timeout = stream.deadline.time_remaining() if stream.deadline else None
493494
self.execution_id = "some execution id"

0 commit comments

Comments
 (0)