Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mentions of robot #781

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/viam/components/gantry/gantry.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def get_position(self, *, extra: Optional[Dict[str, Any]] = None, timeout:

::

my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")

# Get the current positions of the axes of the gantry in millimeters.
positions = await my_gantry.get_position()
Expand All @@ -59,7 +59,7 @@ async def move_to_position(

::

my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")

# Create a list of positions for the axes of the gantry to move to. Assume in
# this example that the gantry is multi-axis, with 3 axes.
Expand All @@ -86,7 +86,7 @@ async def home(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optiona

::

my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")

await my_gantry.home()

Expand All @@ -103,7 +103,7 @@ async def get_lengths(self, *, extra: Optional[Dict[str, Any]] = None, timeout:

::

my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")

# Get the lengths of the axes of the gantry in millimeters.
lengths_mm = await my_gantry.get_lengths()
Expand All @@ -122,7 +122,7 @@ async def stop(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optiona

::

my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")

# Stop all motion of the gantry. It is assumed that the gantry stops
# immediately.
Expand All @@ -139,7 +139,7 @@ async def is_moving(self) -> bool:

::

my_gantry = Gantry.from_robot(robot=robot, name="my_gantry")
my_gantry = Gantry.from_robot(robot=machine, name="my_gantry")

# Stop all motion of the gantry. It is assumed that the
# gantry stops immediately.
Expand Down
8 changes: 4 additions & 4 deletions src/viam/components/gripper/gripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def open(

::

my_gripper = Gripper.from_robot(robot=robot, name="my_gripper")
my_gripper = Gripper.from_robot(robot=machine, name="my_gripper")

# Open the gripper.
await my_gripper.open()
Expand All @@ -59,7 +59,7 @@ async def grab(

::

my_gripper = Gripper.from_robot(robot=robot, name="my_gripper")
my_gripper = Gripper.from_robot(robot=machine, name="my_gripper")

# Grab with the gripper.
grabbed = await my_gripper.grab()
Expand All @@ -84,7 +84,7 @@ async def stop(

::

my_gripper = Gripper.from_robot(robot=robot, name="my_gripper")
my_gripper = Gripper.from_robot(robot=machine, name="my_gripper")

# Stop the gripper.
await my_gripper.stop()
Expand All @@ -100,7 +100,7 @@ async def is_moving(self) -> bool:

::

my_gripper = Gripper.from_robot(robot=robot, name="my_gripper")
my_gripper = Gripper.from_robot(robot=machine, name="my_gripper")

# Check whether the gripper is currently moving.
moving = await my_gripper.is_moving()
Expand Down
20 changes: 10 additions & 10 deletions src/viam/components/motor/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def set_power(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Set the power to 40% forwards.
await my_motor.set_power(power=0.4)
Expand Down Expand Up @@ -74,7 +74,7 @@ async def go_for(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Turn the motor 7.2 revolutions at 60 RPM.
await my_motor.go_for(rpm=60, revolutions=7.2)
Expand Down Expand Up @@ -107,7 +107,7 @@ async def go_to(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Turn the motor to 8.3 revolutions from home at 75 RPM.
await my_motor.go_to(rpm=75, revolutions=8.3)
Expand Down Expand Up @@ -135,7 +135,7 @@ async def set_rpm(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Spin the motor at 75 RPM.
await my_motor.set_rpm(rpm=75)
Expand All @@ -161,7 +161,7 @@ async def reset_zero_position(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Set the current position as the new home position with no offset.
await my_motor.reset_zero_position(offset=0.0)
Expand All @@ -188,7 +188,7 @@ async def get_position(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Get the current position of the motor.
position = await my_motor.get_position()
Expand All @@ -214,7 +214,7 @@ async def get_properties(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Report a dictionary mapping optional properties to whether it is supported by
# this motor.
Expand Down Expand Up @@ -243,7 +243,7 @@ async def stop(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Stop the motor.
await my_motor.stop()
Expand All @@ -265,7 +265,7 @@ async def is_powered(

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Check whether the motor is currently running.
powered = await my_motor.is_powered()
Expand All @@ -287,7 +287,7 @@ async def is_moving(self) -> bool:

::

my_motor = Motor.from_robot(robot=robot, name="my_motor")
my_motor = Motor.from_robot(robot=machine, name="my_motor")

# Check whether the motor is currently moving.
moving = await my_motor.is_moving()
Expand Down
8 changes: 4 additions & 4 deletions src/viam/components/power_sensor/power_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def get_voltage(self, *, extra: Optional[Dict[str, Any]] = None, timeout:

::

my_power_sensor = PowerSensor.from_robot(robot=robot, name='my_power_sensor')
my_power_sensor = PowerSensor.from_robot(robot=machine, name='my_power_sensor')

# Get the voltage reading from the power sensor
voltage, is_ac = await my_power_sensor.get_voltage()
Expand All @@ -49,7 +49,7 @@ async def get_current(self, *, extra: Optional[Dict[str, Any]] = None, timeout:

::

my_power_sensor = PowerSensor.from_robot(robot=robot, name='my_power_sensor')
my_power_sensor = PowerSensor.from_robot(robot=machine, name='my_power_sensor')

# Get the current reading from the power sensor
current, is_ac = await my_power_sensor.get_current()
Expand All @@ -69,7 +69,7 @@ async def get_power(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Op

::

my_power_sensor = PowerSensor.from_robot(robot=robot, name='my_power_sensor')
my_power_sensor = PowerSensor.from_robot(robot=machine, name='my_power_sensor')

# Get the power reading from the power sensor
power = await my_power_sensor.get_power()
Expand All @@ -90,7 +90,7 @@ async def get_readings(

::

my_power_sensor = PowerSensor.from_robot(robot=robot, name='my_power_sensor')
my_power_sensor = PowerSensor.from_robot(robot=machine, name='my_power_sensor')

# Get the readings provided by the sensor.
readings = await my_power_sensor.get_readings()
Expand Down
2 changes: 1 addition & 1 deletion src/viam/components/sensor/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def get_readings(

::

my_sensor = Sensor.from_robot(robot=robot, name='my_sensor')
my_sensor = Sensor.from_robot(robot=machine, name='my_sensor')

# Get the readings provided by the sensor.
readings = await my_sensor.get_readings()
Expand Down
8 changes: 4 additions & 4 deletions src/viam/components/servo/servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def move(self, angle: int, *, extra: Optional[Mapping[str, Any]] = None, t

::

my_servo = Servo.from_robot(robot=robot, name="my_servo")
my_servo = Servo.from_robot(robot=machine, name="my_servo")

# Move the servo from its origin to the desired angle of 10 degrees.
await my_servo.move(10)
Expand All @@ -54,7 +54,7 @@ async def get_position(self, *, extra: Optional[Mapping[str, Any]] = None, timeo

::

my_servo = Servo.from_robot(robot=robot, name="my_servo")
my_servo = Servo.from_robot(robot=machine, name="my_servo")

# Move the servo from its origin to the desired angle of 10 degrees.
await my_servo.move(10)
Expand Down Expand Up @@ -82,7 +82,7 @@ async def stop(self, *, extra: Optional[Mapping[str, Any]] = None, timeout: Opti

::

my_servo = Servo.from_robot(robot=robot, name="my_servo")
my_servo = Servo.from_robot(robot=machine, name="my_servo")

# Move the servo from its origin to the desired angle of 10 degrees.
await my_servo.move(10)
Expand All @@ -101,7 +101,7 @@ async def is_moving(self) -> bool:

::

my_servo = Servo.from_robot(robot=robot, name="my_servo")
my_servo = Servo.from_robot(robot=machine, name="my_servo")

print(await my_servo.is_moving())

Expand Down
4 changes: 2 additions & 2 deletions src/viam/services/mlmodel/mlmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def infer(self, input_tensors: Dict[str, NDArray], *, timeout: Optional[fl

import numpy as np

my_mlmodel = MLModelClient.from_robot(robot=robot, name="my_mlmodel_service")
my_mlmodel = MLModelClient.from_robot(robot=machine, name="my_mlmodel_service")

nd_array = np.array([1, 2, 3], dtype=np.float64)
input_tensors = {"0": nd_array}
Expand All @@ -55,7 +55,7 @@ async def metadata(self, *, timeout: Optional[float]) -> Metadata:

::

my_mlmodel = MLModelClient.from_robot(robot=robot, name="my_mlmodel_service")
my_mlmodel = MLModelClient.from_robot(robot=machine, name="my_mlmodel_service")

metadata = await my_mlmodel.metadata()

Expand Down
12 changes: 6 additions & 6 deletions src/viam/services/motion/motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def move(

::

motion = MotionClient.from_robot(robot=robot, name="builtin")
motion = MotionClient.from_robot(robot=machine, name="builtin")

# Assumes a gripper configured with name "my_gripper" on the machine
gripper_name = Gripper.get_resource_name("my_gripper")
Expand Down Expand Up @@ -110,7 +110,7 @@ async def move_on_globe(

::

motion = MotionClient.from_robot(robot=robot, name="builtin")
motion = MotionClient.from_robot(robot=machine, name="builtin")

# Get the ResourceNames of the base and movement sensor
my_base_resource_name = Base.get_resource_name("my_base")
Expand Down Expand Up @@ -184,7 +184,7 @@ async def move_on_map(

::

motion = MotionClient.from_robot(robot=robot, name="builtin")
motion = MotionClient.from_robot(robot=machine, name="builtin")

# Get the ResourceNames of the base component and SLAM service
my_base_resource_name = Base.get_resource_name("my_base")
Expand Down Expand Up @@ -282,7 +282,7 @@ async def get_plan(

::

motion = MotionClient.from_robot(robot=robot, name="builtin")
motion = MotionClient.from_robot(robot=machine, name="builtin")
my_base_resource_name = Base.get_resource_name("my_base")
# Get the plan(s) of the base component which was instructed to move by `MoveOnGlobe()` or `MoveOnMap()`
resp = await motion.get_plan(component_name=my_base_resource_name)
Expand Down Expand Up @@ -317,7 +317,7 @@ async def list_plan_statuses(

::

motion = MotionClient.from_robot(robot=robot, name="builtin")
motion = MotionClient.from_robot(robot=machine, name="builtin")
# List the plan statuses of the motion service within the TTL
resp = await motion.list_plan_statuses()

Expand Down Expand Up @@ -359,7 +359,7 @@ async def get_pose(
# Assume that the connect function is written and will return a valid machine.
robot = await connect()

motion = MotionClient.from_robot(robot=robot, name="builtin")
motion = MotionClient.from_robot(robot=machine, name="builtin")
gripperName = Gripper.get_resource_name("my_gripper")
gripperPoseInWorld = await motion.get_pose(component_name=gripperName,
destination_frame="world")
Expand Down
Loading
Loading