Skip to content

timrobot/Cortano

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cortano

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.

Getting Started

  1. 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.

  1. Install this repository to to your laptop/desktop.
python3 -m pip install .
  1. 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

API

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
  • color: uint8[360, 640, 3]
  • depth: uint16[360, 640]
  • sensors: float[20]
  • info: {...}
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

About

Remote Interface for CortexNanoBridge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages