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

fix(RPS-1174): dont deactivate motion groups #35

Merged
merged 8 commits into from
Feb 4, 2025
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
13 changes: 9 additions & 4 deletions .github/workflows/run-examples.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Run examples

on:
pull_request:
branches:
- main
# we are unable to create cloud instances as of now
#pull_request:
# branches:
# - main

jobs:
run-examples:
Expand Down Expand Up @@ -45,7 +46,11 @@ jobs:
GITHUB_RUN_ID: ${{ github.run_id }}
INSECURE_CURL: "true" # If you need to skip SSL verification
run: |
source ./scripts/create_nova_instance.sh
if ! source ./scripts/create_nova_instance.sh; then
echo "Failed to create NOVA instance."
exit 1
fi

echo $PORTAL_STG_HOST
echo "PORTAL_STG_HOST=$PORTAL_STG_HOST" >> $GITHUB_ENV
echo "PORTAL_STG_INSTANCE_ID=$PORTAL_STG_INSTANCE_ID" >> $GITHUB_ENV
Expand Down
1 change: 0 additions & 1 deletion examples/03_move_and_set_ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ async def main():
jnt(home_joints),
]

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

await cell.delete_robot_controller(controller.name)
Expand Down
7 changes: 4 additions & 3 deletions nova/core/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ async def __aenter__(self):

@final
async def __aexit__(self, exc_type, exc_val, exc_tb):
for motion_group_id in self._activated_motion_group_ids:
logger.info(f"Deactivating motion group {motion_group_id}")
await self._motion_group_api.deactivate_motion_group(self._cell, motion_group_id)
# RPS-1174: when a motion group is deactivated, RAE closes all open connections
mahsumdemirwb marked this conversation as resolved.
Show resolved Hide resolved
# this behaviour is not desired in some cases,
# so for now we will not deactivate for the user
pass

def __len__(self) -> int:
return len(self._activated_motion_group_ids)
Expand Down
7 changes: 4 additions & 3 deletions nova/core/motion_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ async def __aenter__(self):
return self

async def __aexit__(self, exc_type, exc_val, exc_tb):
await self._api_gateway.motion_group_api.deactivate_motion_group(
cell=self._cell, motion_group=self._motion_group_id
)
# RPS-1174: when a motion group is deactivated, RAE closes all open connections
# this behaviour is not desired in some cases,
# so for now we will not deactivate for the user
pass

@property
def motion_group_id(self) -> str:
Expand Down
1 change: 1 addition & 0 deletions nova/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def __init__(
self.virtual_robot_setup_api = intercept(
wb.VirtualRobotSetupApi(api_client=self._api_client)
)
self.controller_ios_api = intercept(wb.ControllerIOsApi(api_client=self._api_client))

async def close(self):
return await self._api_client.close()
8 changes: 6 additions & 2 deletions scripts/create_nova_instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ echo "Access token received."
SANDBOX_NAME="svcmgr-${GITHUB_RUN_ID:-local-run}"
echo "Creating instance with sandbox name: ${SANDBOX_NAME}"

INSTANCE_RESPONSE="$(curl -X "POST" "https://io.stg.wandelbots.io/instance" \
if ! INSTANCE_RESPONSE="$(curl -X "POST" "https://io.stg.wandelbots.io/instance" \
-H "accept: application/json" \
-H "Authorization: Bearer ${PORTAL_STG_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"sandbox_name\": \"${SANDBOX_NAME}\"}")"
-d "{\"sandbox_name\": \"${SANDBOX_NAME}\"}")"; then
echo "Failed to create a new instance."
echo "Response from create instance: ${INSTANCE_RESPONSE}"
exit 1
fi

echo "Response from create instance: ${INSTANCE_RESPONSE}"
PORTAL_STG_HOST="$(echo "${INSTANCE_RESPONSE}" | jq -r .host)"
Expand Down