Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cbiering committed Jan 20, 2025
1 parent 7d0eec9 commit 6379d16
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
echo "CELL_NAME=cell" >> ./.env
echo | cat ./.env
PYTHONPATH=. poetry run python examples/01_basic.py
PYTHONPATH=. poetry run python examples/02_plan_and_execute.py
# Always run cleanup, whether success or failure
- name: Cleanup - Delete instance
Expand Down
52 changes: 27 additions & 25 deletions examples/03_move_and_set_ios.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio

from nova import Nova
from nova.api import models

# TODO: update I/O interaction interface
from nova.actions import WriteAction, jnt, ptp
Expand All @@ -16,31 +17,32 @@


async def main():
nova = Nova()
cell = nova.cell()
controllers = await cell.controllers()
controller = controllers[0]

# Connect to the controller and activate motion groups
async with controller[0] as motion_group:
home_joints = await motion_group.joints()
tcp_names = await motion_group.tcp_names()
tcp = tcp_names[0]

# Get current TCP pose and offset it slightly along the x-axis
current_pose = await motion_group.tcp_pose(tcp)
target_pose = current_pose @ Pose((100, 0, 0, 0, 0, 0))
actions = [
jnt(home_joints),
WriteAction(device_id="ur", key="digital_out[0]", value=False),
ptp(target_pose),
jnt(home_joints),
]

# io_value = await controller.read_io("digital_out[0]")
await motion_group.plan_and_execute(actions, tcp)

await nova.close()
with Nova() as nova:
cell = nova.cell()
controller = await cell.ensure_virtual_robot_controller(
"ur",
models.VirtualControllerTypes.UNIVERSALROBOTS_MINUS_UR10E,
models.Manufacturer.UNIVERSALROBOTS,
)

# Connect to the controller and activate motion groups
async with controller[0] as motion_group:
home_joints = await motion_group.joints()
tcp_names = await motion_group.tcp_names()
tcp = tcp_names[0]

# Get current TCP pose and offset it slightly along the x-axis
current_pose = await motion_group.tcp_pose(tcp)
target_pose = current_pose @ Pose((100, 0, 0, 0, 0, 0))
actions = [
jnt(home_joints),
WriteAction(device_id="ur", key="digital_out[0]", value=False),
ptp(target_pose),
jnt(home_joints),
]

# io_value = await controller.read_io("digital_out[0]")
await motion_group.plan_and_execute(actions, tcp)


if __name__ == "__main__":
Expand Down

0 comments on commit 6379d16

Please sign in to comment.