@@ -47,6 +47,16 @@ async def move_straight(
4747 When ``distance`` or ``velocity`` is 0, the base will stop.
4848 This method blocks until completed or cancelled.
4949
50+ ::
51+
52+ my_base = Base.from_robot(robot=robot, name="my_base")
53+
54+ # Move the base 40 mm at a velocity of 90 mm/s, forward.
55+ await my_base.move_straight(distance=40, velocity=90)
56+
57+ # Move the base 40 mm at a velocity of -90 mm/s, backward.
58+ await my_base.move_straight(distance=40, velocity=-90)
59+
5060 Args:
5161 distance (int): The distance (in millimeters) to move.
5262 Negative implies backwards.
@@ -71,6 +81,13 @@ async def spin(
7181 When ``velocity`` is 0, the base will stop.
7282 This method blocks until completed or cancelled.
7383
84+ ::
85+
86+ my_base = Base.from_robot(robot=robot, name="my_base")
87+
88+ # Spin the base 10 degrees at an angular velocity of 15 deg/sec.
89+ await my_base.spin(angle=10, velocity=15)
90+
7491 Args:
7592 angle (float): The angle (in degrees) to spin.
7693 velocity (float): The angular velocity (in degrees per second)
@@ -96,6 +113,34 @@ async def set_power(
96113 When ``linear`` and ``angular`` are both nonzero, the base will move in an arc,
97114 with a tighter radius if angular power is greater than linear power.
98115
116+ ::
117+
118+ my_base = Base.from_robot(robot=robot, name="my_base")
119+
120+ # Make your wheeled base move forward. Set linear power to 75%.
121+ print("move forward")
122+ await my_base.set_power(
123+ linear=Vector3(x=0, y=-.75, z=0),
124+ angular=Vector3(x=0, y=0, z=0))
125+
126+ # Make your wheeled base move backward. Set linear power to -100%.
127+ print("move backward")
128+ await my_base.set_power(
129+ linear=Vector3(x=0, y=-1.0, z=0),
130+ angular=Vector3(x=0, y=0, z=0))
131+
132+ # Make your wheeled base spin left. Set angular power to 100%.
133+ print("spin left")
134+ await my_base.set_power(
135+ linear=Vector3(x=0, y=0, z=0),
136+ angular=Vector3(x=0, y=0, z=1))
137+
138+ # Make your wheeled base spin right. Set angular power to -75%.
139+ print("spin right")
140+ await my_base.set_power(
141+ linear=Vector3(x=0, y=0, z=0),
142+ angular=Vector3(x=0, y=0, z=-.75))
143+
99144 Args:
100145 linear (Vector3): The linear component. Only the Y component is used
101146 for wheeled base. Positive implies forwards.
@@ -117,6 +162,14 @@ async def set_velocity(
117162 """
118163 Set the linear and angular velocities of the base.
119164
165+ ::
166+
167+ my_base = Base.from_robot(robot=robot, name="my_base")
168+
169+ # Set the linear velocity to 50 mm/sec and the angular velocity to
170+ # 15 degree/sec.
171+ await my_base.set_velocity(
172+ linear=Vector3(x=0, y=50, z=0), angular=Vector3(x=0, y=0, z=15))
120173
121174 Args:
122175 linear (Vector3): Velocity in mm/sec
@@ -133,6 +186,16 @@ async def stop(
133186 ):
134187 """
135188 Stop the base.
189+
190+ ::
191+
192+ my_base = Base.from_robot(robot=robot, name="my_base")
193+
194+ # Move the base forward 10 mm at a velocity of 50 mm/s.
195+ await my_base.move_straight(distance=10, velocity=50)
196+
197+ # Stop the base.
198+ await my_base.stop()
136199 """
137200 ...
138201
@@ -141,6 +204,14 @@ async def is_moving(self) -> bool:
141204 """
142205 Get if the base is currently moving.
143206
207+ ::
208+
209+ my_base = Base.from_robot(robot=robot, name="my_base")
210+
211+ # Check whether the base is currently moving.
212+ moving = await my_base.is_moving()
213+ print('Moving: ', moving)
214+
144215 Returns:
145216 bool: Whether the base is moving.
146217 """
@@ -151,6 +222,22 @@ async def get_properties(self, *, timeout: Optional[float] = None, **kwargs) ->
151222 """
152223 Get the base width and turning radius
153224
225+ ::
226+
227+ my_base = Base.from_robot(robot=robot, name="my_base")
228+
229+ # Get the width and turning radius of the base
230+ properties = await my_base.get_properties()
231+
232+ # Get the width
233+ print(f"Width of base: {properties.width_meters}")
234+
235+ # Get the turning radius
236+ print(f"Turning radius of base: {properties.turning_radius_meters}")
237+
238+ # Get the wheel circumference
239+ print(f"Wheel circumference of base: {properties.wheel_circumference_meters}")
240+
154241 Returns:
155242 Properties: The properties of the base
156243 """
0 commit comments