Difference between revisions of "JETANK AI Kit-Teleoperation"

From Waveshare Wiki
Jump to: navigation, search
Line 13: Line 13:
 
*Open the https://html5gamepad.com/ webpage, check whether the controller is connected properly, and write down the INDEX value of the corresponding device; at this time, press the remote control and the corresponding value on the webpage will change accordingly.
 
*Open the https://html5gamepad.com/ webpage, check whether the controller is connected properly, and write down the INDEX value of the corresponding device; at this time, press the remote control and the corresponding value on the webpage will change accordingly.
 
[[File:jetankGamepad Control01.jpg]]
 
[[File:jetankGamepad Control01.jpg]]
*Note: INDEX=0 is a normal value, if the connection fails, it will display: No gamepad detected.
+
*After running this code, the window will output the buttons corresponding to the gamepad. Note that the index in the program needs to be modified to the value corresponding to the actual remote control handle, and the corresponding INDEX can be seen on the web page just opened. The button icon corresponding to the button pressed will indicate that the button has been pressed.
*Back in the demo, please odify the index to the actual value of the gamepad. Then determine the actual corresponding value of each button by pressing the button, and then you can set the function of the handle button by yourself.
 
 
[[File:Gamepad Control02.png]]
 
[[File:Gamepad Control02.png]]
*Tip: axes represent sliders, buttons represent squares.
+
*Modify the axes value to correspond to different buttons, here it is changed to axes[0], axes[1] for the convenience of remote control.
*After clarifying the actual values corresponding to different keys, we can write a program to set the key functions by ourselves. For example, the X key represents buttons[3], the B key represents buttons[1], the Y key represents buttons[0], and the A key represents buttons[2], and the corresponding key value is assigned to the motor to control the car to move forward, back, left and right.
 
 
[[File: JetBot AI Kit Manual 9.jpg]]
 
[[File: JetBot AI Kit Manual 9.jpg]]
  

Revision as of 08:49, 16 July 2022

JetBot User Guide

Step 1: Open Teleoperation Program

  • Use Google or Firefox browser to log in to the website http://<jetbot_ip_address>:8888 to connect to the car [jetbot_ip_address is the ip displayed by the car, be careful to remove "<>"], open the folder on the left to "jetbot/notebooks/teleoperation/teleoperation" .ipynb” file
  • Plug the gamepad receiver into the USB port of the computer. [Note] The receiver needs to be connected to the computer instead of the jetson nano. The gamepad needs to be connected to the device that opens the JupyterLab webpage.
  • Open the https://html5gamepad.com/ webpage, check whether the controller is connected properly, and write down the INDEX value of the corresponding device; at this time, press the remote control and the corresponding value on the webpage will change accordingly.

JetankGamepad Control01.jpg

  • After running this code, the window will output the buttons corresponding to the gamepad. Note that the index in the program needs to be modified to the value corresponding to the actual remote control handle, and the corresponding INDEX can be seen on the web page just opened. The button icon corresponding to the button pressed will indicate that the button has been pressed.

Gamepad Control02.png

  • Modify the axes value to correspond to different buttons, here it is changed to axes[0], axes[1] for the convenience of remote control.

JetBot AI Kit Manual 9.jpg

Step 2: Open the Camera

  • Create an image window in the program with the format of jpeg, a resolution of 300 X 300, and display it on the current page.

Gamepad Control04.png

  • If there is an error, please check whether you have enabled the RPI camera interface.
  • Quote the camera functions to call the camera. The image is outputted after running the program.

Gamepad Control 05.jpg

  • When the "heartbeat" checks, the car will stop as soon as the network is failed.

Gamepad Control 06.png

  • Control the car to take photos with buttons. You can choose the different buttons by changing it. Here we use buttons[0].

Gamepad Control 07.jpg

  • After running the program, you can control the car by the gamepad. Asex[0] is for the wheels on the left, Asex[1] is for the wheel on the right, and button[0] is the control for taking pictures. The image on the left shows the real-time image of the camera, the image on the right is the captured image, and the image is saved in the snapshots file.