Skip to content

Instantly share code, notes, and snippets.

@ankitrgadiya
Last active September 23, 2021 18:33
Show Gist options
  • Save ankitrgadiya/6d98de02ec7c5d2f482d66c3aca293cb to your computer and use it in GitHub Desktop.
Save ankitrgadiya/6d98de02ec7c5d2f482d66c3aca293cb to your computer and use it in GitHub Desktop.
Getting Started with Rio CLI
#!/bin/bash
echo "Installing the CLI..."
pip3 install -i https://test.pypi.org/simple/ --extra-index-url=https://pypi.org/simple rapyuta-io-cli
echo "Ensure docker is running..."
sudo systemctl start docker
echo "Run a virtual robot inside docker..."
docker run \
-d \
--name test-robot \
--security-opt seccomp=unconfined \
--tmpfs /run \
--tmpfs /run/lock \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-v ~/.ssh:/root/.ssh \
-p 22:22 \
smruti59/ros-kinetic-device:latest
docker ps
echo "Setup robot for onboarding..."
docker exec -it test-robot /bin/bash -c "apt update && apt install sudo -y"
rio auth login
rio device create test-robot --python 2 --runtime preinstalled --catkin-workspace /root/catkin_ws
echo "Onboarding the robot using CLI..."
docker exec -it test-robot /bin/bash -c "$(rio device onboard test-robot)"
until rio device list | grep 'test-robot' | grep 'ONLINE'
do
clear
rio device list
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment