Remote Interface for Jetson Nano + Vex Cortex, which connects to the robot. The partner component that should be installed first on the robot's Jetson Nano can be found at CortexNanoBridge.
- Get your Jetson's IP address. This can be done by typing the following into a new terminal:
ifconfig
Your IP Address should be the IPv4 address (ie. 192.168.1.100) under wlan0.
- Install this repository to to your laptop/desktop.
python3 -m pip install .
- You can now run an example program to read sensor data and camera frames from the robot
from cortano import RemoteInterface
if __name__ == "__main__":
robot = RemoteInterface("192.168.1.100") # remember to put your ip here
while robot.running():
color, depth, sensors, info = robot.read()
To control a robot, set the motor values (0-10) to anywhere between [-1, 1]
from cortano import RemoteInterface
if __name__ == "__main__":
robot = RemoteInterface("192.168.1.100")
while robot.running():
forward = robot.keys["w"] - robot.keys["s"]
robot.motor[0] = forward * 0.5
robot.motor[9] = forward * -0.5
The info struct contains additional information:
battery | 0.0 - 14.0V or 0-100% |
cam2 | second camera's color frame (optional) |
time | timestamp on robot when data was sent |
Method | Description | Return |
---|---|---|
RemoteInterface(host, port) |
Constructor. Initialize socket connection to robot using host and port=(default: 9999) |
RemoteInterface |
running() |
Inspect whether or not a robot is still running | bool |
read() |
Get sensor values, camera frames, and power level from the robot |
|
motor[port] |
Set a motor port value between [-1, 1] |
ref(float) |
keys[keyname] |
Given a keyname:char , returns if pressed down or not |
1 if pressed, 0 otherwise |