Verify your Setup and Get Started
In order to verify your computer’s setup, we are going to run a program from it, and see if the robot answers as expected.
Note
Before verifying your setup, be sure that your physical robot (or simulation) is turned on.
Firstly, go in the folder of your choice and create an empty file named “pyniryo_test.py”. This file will contain the checking code.
Edit this file and fill it with the following code
1from pyniryo import NiryoRobot, JointsPosition
2
3robot_ip_address = '<robot_ip_address>'
4
5# Connect to robot & calibrate
6robot = NiryoRobot(robot_ip_address)
7robot.calibrate_auto()
8# Move joints
9robot.move(JointsPosition(0.0, 0.0, 0.0, 0.0, 0.0, 0.0))
10# Turn learning mode ON
11robot.set_learning_mode(True)
12# Stop TCP connection
13robot.close_connection()
Attention
Replace the third line with your Robot IP Address if you are not using Hotspot Mode.
Still on your computer, open a terminal, and place your current directory in the same folder than your file. Then, run the command:
python pyniryo_test.py
Note
If you are using Python 3, you may need to change python
to python3
.
If your robot starts calibrating, then moves, and finally, goes to learning mode, your setup is validated, you can now start coding!