Skip to content

Commit f7b35b8

Browse files
authored
Remove mentions of robot (#781)
1 parent 36bc4d0 commit f7b35b8

File tree

12 files changed

+60
-60
lines changed

12 files changed

+60
-60
lines changed

src/viam/components/gantry/gantry.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def get_position(self, *, extra: Optional[Dict[str, Any]] = None, timeout:
3232
3333
::
3434
35-
my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
35+
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")
3636
3737
# Get the current positions of the axes of the gantry in millimeters.
3838
positions = await my_gantry.get_position()
@@ -59,7 +59,7 @@ async def move_to_position(
5959
6060
::
6161
62-
my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
62+
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")
6363
6464
# Create a list of positions for the axes of the gantry to move to. Assume in
6565
# this example that the gantry is multi-axis, with 3 axes.
@@ -86,7 +86,7 @@ async def home(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optiona
8686
8787
::
8888
89-
my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
89+
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")
9090
9191
await my_gantry.home()
9292
@@ -103,7 +103,7 @@ async def get_lengths(self, *, extra: Optional[Dict[str, Any]] = None, timeout:
103103
104104
::
105105
106-
my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
106+
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")
107107
108108
# Get the lengths of the axes of the gantry in millimeters.
109109
lengths_mm = await my_gantry.get_lengths()
@@ -122,7 +122,7 @@ async def stop(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optiona
122122
123123
::
124124
125-
my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
125+
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")
126126
127127
# Stop all motion of the gantry. It is assumed that the gantry stops
128128
# immediately.
@@ -139,7 +139,7 @@ async def is_moving(self) -> bool:
139139
140140
::
141141
142-
my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
142+
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")
143143
144144
# Stop all motion of the gantry. It is assumed that the
145145
# gantry stops immediately.

src/viam/components/gripper/gripper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def open(
3737
3838
::
3939
40-
my_gripper = Gripper.from_robot(robot=robot, name="my_gripper")
40+
my_gripper = Gripper.from_robot(robot=machine, name="my_gripper")
4141
4242
# Open the gripper.
4343
await my_gripper.open()
@@ -59,7 +59,7 @@ async def grab(
5959
6060
::
6161
62-
my_gripper = Gripper.from_robot(robot=robot, name="my_gripper")
62+
my_gripper = Gripper.from_robot(robot=machine, name="my_gripper")
6363
6464
# Grab with the gripper.
6565
grabbed = await my_gripper.grab()
@@ -84,7 +84,7 @@ async def stop(
8484
8585
::
8686
87-
my_gripper = Gripper.from_robot(robot=robot, name="my_gripper")
87+
my_gripper = Gripper.from_robot(robot=machine, name="my_gripper")
8888
8989
# Stop the gripper.
9090
await my_gripper.stop()
@@ -100,7 +100,7 @@ async def is_moving(self) -> bool:
100100
101101
::
102102
103-
my_gripper = Gripper.from_robot(robot=robot, name="my_gripper")
103+
my_gripper = Gripper.from_robot(robot=machine, name="my_gripper")
104104
105105
# Check whether the gripper is currently moving.
106106
moving = await my_gripper.is_moving()

src/viam/components/motor/motor.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def set_power(
4444
4545
::
4646
47-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
47+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
4848
4949
# Set the power to 40% forwards.
5050
await my_motor.set_power(power=0.4)
@@ -74,7 +74,7 @@ async def go_for(
7474
7575
::
7676
77-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
77+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
7878
7979
# Turn the motor 7.2 revolutions at 60 RPM.
8080
await my_motor.go_for(rpm=60, revolutions=7.2)
@@ -107,7 +107,7 @@ async def go_to(
107107
108108
::
109109
110-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
110+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
111111
112112
# Turn the motor to 8.3 revolutions from home at 75 RPM.
113113
await my_motor.go_to(rpm=75, revolutions=8.3)
@@ -135,7 +135,7 @@ async def set_rpm(
135135
136136
::
137137
138-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
138+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
139139
140140
# Spin the motor at 75 RPM.
141141
await my_motor.set_rpm(rpm=75)
@@ -161,7 +161,7 @@ async def reset_zero_position(
161161
162162
::
163163
164-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
164+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
165165
166166
# Set the current position as the new home position with no offset.
167167
await my_motor.reset_zero_position(offset=0.0)
@@ -188,7 +188,7 @@ async def get_position(
188188
189189
::
190190
191-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
191+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
192192
193193
# Get the current position of the motor.
194194
position = await my_motor.get_position()
@@ -214,7 +214,7 @@ async def get_properties(
214214
215215
::
216216
217-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
217+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
218218
219219
# Report a dictionary mapping optional properties to whether it is supported by
220220
# this motor.
@@ -243,7 +243,7 @@ async def stop(
243243
244244
::
245245
246-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
246+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
247247
248248
# Stop the motor.
249249
await my_motor.stop()
@@ -265,7 +265,7 @@ async def is_powered(
265265
266266
::
267267
268-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
268+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
269269
270270
# Check whether the motor is currently running.
271271
powered = await my_motor.is_powered()
@@ -287,7 +287,7 @@ async def is_moving(self) -> bool:
287287
288288
::
289289
290-
my_motor = Motor.from_robot(robot=robot, name="my_motor")
290+
my_motor = Motor.from_robot(robot=machine, name="my_motor")
291291
292292
# Check whether the motor is currently moving.
293293
moving = await my_motor.is_moving()

src/viam/components/power_sensor/power_sensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def get_voltage(self, *, extra: Optional[Dict[str, Any]] = None, timeout:
2929
3030
::
3131
32-
my_power_sensor = PowerSensor.from_robot(robot=robot, name='my_power_sensor')
32+
my_power_sensor = PowerSensor.from_robot(robot=machine, name='my_power_sensor')
3333
3434
# Get the voltage reading from the power sensor
3535
voltage, is_ac = await my_power_sensor.get_voltage()
@@ -49,7 +49,7 @@ async def get_current(self, *, extra: Optional[Dict[str, Any]] = None, timeout:
4949
5050
::
5151
52-
my_power_sensor = PowerSensor.from_robot(robot=robot, name='my_power_sensor')
52+
my_power_sensor = PowerSensor.from_robot(robot=machine, name='my_power_sensor')
5353
5454
# Get the current reading from the power sensor
5555
current, is_ac = await my_power_sensor.get_current()
@@ -69,7 +69,7 @@ async def get_power(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Op
6969
7070
::
7171
72-
my_power_sensor = PowerSensor.from_robot(robot=robot, name='my_power_sensor')
72+
my_power_sensor = PowerSensor.from_robot(robot=machine, name='my_power_sensor')
7373
7474
# Get the power reading from the power sensor
7575
power = await my_power_sensor.get_power()
@@ -90,7 +90,7 @@ async def get_readings(
9090
9191
::
9292
93-
my_power_sensor = PowerSensor.from_robot(robot=robot, name='my_power_sensor')
93+
my_power_sensor = PowerSensor.from_robot(robot=machine, name='my_power_sensor')
9494
9595
# Get the readings provided by the sensor.
9696
readings = await my_power_sensor.get_readings()

src/viam/components/sensor/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def get_readings(
3535
3636
::
3737
38-
my_sensor = Sensor.from_robot(robot=robot, name='my_sensor')
38+
my_sensor = Sensor.from_robot(robot=machine, name='my_sensor')
3939
4040
# Get the readings provided by the sensor.
4141
readings = await my_sensor.get_readings()

src/viam/components/servo/servo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def move(self, angle: int, *, extra: Optional[Mapping[str, Any]] = None, t
3232
3333
::
3434
35-
my_servo = Servo.from_robot(robot=robot, name="my_servo")
35+
my_servo = Servo.from_robot(robot=machine, name="my_servo")
3636
3737
# Move the servo from its origin to the desired angle of 10 degrees.
3838
await my_servo.move(10)
@@ -54,7 +54,7 @@ async def get_position(self, *, extra: Optional[Mapping[str, Any]] = None, timeo
5454
5555
::
5656
57-
my_servo = Servo.from_robot(robot=robot, name="my_servo")
57+
my_servo = Servo.from_robot(robot=machine, name="my_servo")
5858
5959
# Move the servo from its origin to the desired angle of 10 degrees.
6060
await my_servo.move(10)
@@ -82,7 +82,7 @@ async def stop(self, *, extra: Optional[Mapping[str, Any]] = None, timeout: Opti
8282
8383
::
8484
85-
my_servo = Servo.from_robot(robot=robot, name="my_servo")
85+
my_servo = Servo.from_robot(robot=machine, name="my_servo")
8686
8787
# Move the servo from its origin to the desired angle of 10 degrees.
8888
await my_servo.move(10)
@@ -101,7 +101,7 @@ async def is_moving(self) -> bool:
101101
102102
::
103103
104-
my_servo = Servo.from_robot(robot=robot, name="my_servo")
104+
my_servo = Servo.from_robot(robot=machine, name="my_servo")
105105
106106
print(await my_servo.is_moving())
107107

src/viam/services/mlmodel/mlmodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def infer(self, input_tensors: Dict[str, NDArray], *, timeout: Optional[fl
3232
3333
import numpy as np
3434
35-
my_mlmodel = MLModelClient.from_robot(robot=robot, name="my_mlmodel_service")
35+
my_mlmodel = MLModelClient.from_robot(robot=machine, name="my_mlmodel_service")
3636
3737
nd_array = np.array([1, 2, 3], dtype=np.float64)
3838
input_tensors = {"0": nd_array}
@@ -55,7 +55,7 @@ async def metadata(self, *, timeout: Optional[float]) -> Metadata:
5555
5656
::
5757
58-
my_mlmodel = MLModelClient.from_robot(robot=robot, name="my_mlmodel_service")
58+
my_mlmodel = MLModelClient.from_robot(robot=machine, name="my_mlmodel_service")
5959
6060
metadata = await my_mlmodel.metadata()
6161

src/viam/services/motion/motion.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def move(
5252
5353
::
5454
55-
motion = MotionClient.from_robot(robot=robot, name="builtin")
55+
motion = MotionClient.from_robot(robot=machine, name="builtin")
5656
5757
# Assumes a gripper configured with name "my_gripper" on the machine
5858
gripper_name = Gripper.get_resource_name("my_gripper")
@@ -110,7 +110,7 @@ async def move_on_globe(
110110
111111
::
112112
113-
motion = MotionClient.from_robot(robot=robot, name="builtin")
113+
motion = MotionClient.from_robot(robot=machine, name="builtin")
114114
115115
# Get the ResourceNames of the base and movement sensor
116116
my_base_resource_name = Base.get_resource_name("my_base")
@@ -184,7 +184,7 @@ async def move_on_map(
184184
185185
::
186186
187-
motion = MotionClient.from_robot(robot=robot, name="builtin")
187+
motion = MotionClient.from_robot(robot=machine, name="builtin")
188188
189189
# Get the ResourceNames of the base component and SLAM service
190190
my_base_resource_name = Base.get_resource_name("my_base")
@@ -282,7 +282,7 @@ async def get_plan(
282282
283283
::
284284
285-
motion = MotionClient.from_robot(robot=robot, name="builtin")
285+
motion = MotionClient.from_robot(robot=machine, name="builtin")
286286
my_base_resource_name = Base.get_resource_name("my_base")
287287
# Get the plan(s) of the base component which was instructed to move by `MoveOnGlobe()` or `MoveOnMap()`
288288
resp = await motion.get_plan(component_name=my_base_resource_name)
@@ -317,7 +317,7 @@ async def list_plan_statuses(
317317
318318
::
319319
320-
motion = MotionClient.from_robot(robot=robot, name="builtin")
320+
motion = MotionClient.from_robot(robot=machine, name="builtin")
321321
# List the plan statuses of the motion service within the TTL
322322
resp = await motion.list_plan_statuses()
323323
@@ -359,7 +359,7 @@ async def get_pose(
359359
# Assume that the connect function is written and will return a valid machine.
360360
robot = await connect()
361361
362-
motion = MotionClient.from_robot(robot=robot, name="builtin")
362+
motion = MotionClient.from_robot(robot=machine, name="builtin")
363363
gripperName = Gripper.get_resource_name("my_gripper")
364364
gripperPoseInWorld = await motion.get_pose(component_name=gripperName,
365365
destination_frame="world")

0 commit comments

Comments
 (0)