Skip to content

Commit 6a7f66b

Browse files
viambotgithub-actions[bot]
authored andcommitted
[WORKFLOW] AI update based on proto changes from commit db42941
1 parent f5813b8 commit 6a7f66b

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

src/viam/services/motion/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
MoveRequest,
3232
MoveResponse,
3333
PlanStatusWithID,
34+
PseudolinearConstraint,
3435
StopPlanRequest,
3536
StopPlanResponse,
3637
)

src/viam/services/motion/motion.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing_extensions import TypeAlias
99

1010
from viam.proto.common import GeoGeometry, Geometry, GeoPoint, Pose, PoseInFrame, ResourceName, Transform, WorldState
11-
from viam.proto.service.motion import Constraints, GetPlanResponse, MotionConfiguration, PlanStatusWithID
11+
from viam.proto.service.motion import Constraints, GetPlanResponse, MotionConfiguration, PlanStatusWithID, PseudolinearConstraint
1212
from viam.resource.types import API, RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE
1313
from viam.utils import ValueTypes
1414

@@ -75,7 +75,15 @@ async def move(
7575
world_state (viam.proto.common.WorldState): When supplied, the motion service will create a plan that obeys any constraints
7676
expressed in the WorldState message.
7777
constraints (viam.proto.service.motion.Constraints): When supplied, the motion service will create a plan that obeys any
78-
specified constraints.
78+
specified constraints. These can include:
79+
- LinearConstraint: Specifies that the component being moved should move linearly relative to its goal.
80+
- OrientationConstraint: Specifies that the component being moved will not deviate its orientation beyond some threshold
81+
relative to the goal.
82+
- CollisionSpecification: Used to selectively apply obstacle avoidance to specific parts of the robot.
83+
- PseudolinearConstraint: Specifies that the component being moved should not deviate from the straight-line path to their
84+
goal by more than a factor proportional to the distance from start to goal. For example, if a component is moving 100mm,
85+
then a LineToleranceFactor of 1.0 means that the component will remain within a 100mm radius of the straight-line
86+
start-goal path.
7987
8088
Returns:
8189
bool: Whether the move was successful.

src/viam/services/motion/service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
MoveOnMapResponse,
1515
MoveRequest,
1616
MoveResponse,
17+
PseudolinearConstraint,
1718
StopPlanRequest,
1819
StopPlanResponse,
1920
UnimplementedMotionServiceBase,

tests/mocks/services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@
359359
MoveOnMapResponse,
360360
MoveRequest,
361361
MoveResponse,
362+
PseudolinearConstraint,
362363
StopPlanRequest,
363364
StopPlanResponse,
364365
)

tests/test_motion_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
PlanWithStatus,
2222
)
2323
from viam.proto.common import GeoGeometry, Geometry, GeoPoint, Pose, PoseInFrame, ResourceName, Transform, WorldState
24-
from viam.proto.service.motion import Constraints, LinearConstraint, MotionConfiguration
24+
from viam.proto.service.motion import Constraints, LinearConstraint, MotionConfiguration, PseudolinearConstraint
2525
from viam.resource.manager import ResourceManager
2626
from viam.services.motion import MotionClient
2727
from viam.services.motion.motion import Motion
@@ -125,7 +125,7 @@ async def test_move(self, motion: Motion, service: MotionRPCService):
125125
resource_name = Arm.get_resource_name("arm")
126126
destination = PoseInFrame(reference_frame="refframe")
127127
world_state = WorldState(transforms=[Transform(reference_frame="ws_tfrm_rf")])
128-
constraints = Constraints(linear_constraint=[LinearConstraint(), LinearConstraint(line_tolerance_mm=2)])
128+
constraints = Constraints(linear_constraint=[LinearConstraint(), LinearConstraint(line_tolerance_mm=2)], pseudolinear_constraint=[PseudolinearConstraint(line_tolerance_factor=1.0, orientation_tolerance_factor=0.5)])
129129
extra = {"foo": "bar"}
130130
timeout = 2
131131
success = await client.move(

0 commit comments

Comments
 (0)