Comments (15)
Are you sure that you are connecting the gamepad to pc instead of robot?
if connected it right this would be appear
from jetbot.
@dennis08 The joystick is intended to be connected to the desktop machine which is remotely connected to the JetBot. I got the same error as you while the gamepad was connected to the JetBot.
from jetbot.
Since I only have one gamepad, I use index 0.
controller = widgets.Controller(index=0)
from jetbot.
A couple of things.
- unlink after successfully linking (before linking again)
- The remote controller USB dongle goes on the computer you're viewing the notebook on
- I had to press home twice to get two lights to show up on the game pad, and then I could link axis 5 to the right wheel, where as in any other mode only the left wheel gets hooked up to axis[1]. View the html5gamepad or starting widget display to validate you're using a valid axis.
from jetbot.
By the way.
When I execute traitlets, also get some errors.
`
from jetbot import Robot
import traitlets
robot = Robot()
left_link = traitlets.dlink((controller.axes[1], 'value'), (robot.left_motor, 'value'), transform=lambda x: -x)
right_link = traitlets.dlink((controller.axes[3], 'value'), (robot.right_motor, 'value'), transform=lambda x: -x)
`
ERRORS:
`
IndexError Traceback (most recent call last)
in
2 # the commands transfered
3
----> 4 left_link = traitlets.dlink((controller.axes[1], 'value'), (robot.left_motor, 'value'), transform=lambda x: -x)
5 right_link = traitlets.dlink((controller.axes[3], 'value'), (robot.right_motor, 'value'), transform=lambda x: -x)
6 camera_link = traitlets.dlink((camera, 'value'), (image, 'value'), transform=bgr8_to_jpeg)
IndexError: tuple index out of range
`
from jetbot.
Hi dennis08,
Typically, this means that the gamepad wasn't found (or initialized, ie by pressing a button) for the index that you selected.
- Check if your gamepad responds by navigating to https://html5gamepad.com/ and moving the axes around
- Note the index of the gamepad that responds to the axis movements, use this value in the notebook.
Best,
John
from jetbot.
Hi dennis08,
Since there need a third party Gamepad Controller to control Jetbot, so I create a project based on Flask and HTML/JavaScript, with this project, you can only use mobile phone browser to control Jetbot.
Project: https://github.com/mayuanjason/mbot
Project Wiki: https://github.com/mayuanjason/mbot/wiki/Remote-Control
The Wiki is written in Chinese, but I think the codes should be fairly self-explanatory, you can follow the the commands listed in the Wiki in your PC(not Jetson Nano) and have a try.
Hope you enjoy it.
from jetbot.
Hi dennis08,
Typically, this means that the gamepad wasn't found (or initialized, ie by pressing a button) for the index that you selected.
- Check if your gamepad responds by navigating to https://html5gamepad.com/ and moving the axes around
- Note the index of the gamepad that responds to the axis movements, use this value in the notebook.
Best,
John
Dear John,
Sure.
- My gamepad responds by navigating to https://html5gamepad.com/ is fine, and buttons reponse is fine too.
- And The index of my gamepad is "1".
I try to buy another gamepad to control it.
Thnaks so much.
from jetbot.
Hi dennis08,
Since there need a third party Gamepad Controller to control Jetbot, so I create a project based on Flask and HTML/JavaScript, with this project, you can only use mobile phone browser to control Jetbot.
Project: https://github.com/mayuanjason/mbot
Project Wiki: https://github.com/mayuanjason/mbot/wiki/Remote-ControlThe Wiki is written in Chinese, but I think the codes should be fairly self-explanatory, you can follow the the commands listed in the Wiki in your PC(not Jetson Nano) and have a try.
Hope you enjoy it.
Dear mayuanjason ,
Excellent, I will try it, thanks for your suggestion.
from jetbot.
Hi dennis08,
I have refactoring the whole program and test it on my Jetbot, it can work now.
Just check the latest Wiki for how to run the program.
Wiki: https://github.com/mayuanjason/mbot/wiki/Remote-Control
Hope you enjoy it.
from jetbot.
i have the same error. The game controller works on the website https://html5gamepad.com/ but not on jupyter . ill also try the remote controll
from jetbot.
I have the same problem... I have the index set correctly and have tried 3 controllers (2 no name brand controllers and an official xbox one controller) just for a sanity check. I have seen the link above but i dont want to use my phone or tablet to control this.
For me, I have 3 scenarios...
1: it works without throwing the tuple index out of range (maybe 30% of the time or less).
2: it throws the tuple index out of range error and doesnt work (60% of the time or more).
3: it throws the tuple index out of range error and decides to work anyways. BOTH motors can be controlled using the controller despite it throwing the error at left_link.
The example code throws it even! I'm just starting out with coding... idk how to fix this yet. Hoping someone can help me out.
from jetbot.
I too am also having the same problem. I can see the axis moving in the widgets in the program, but no movement.
from jetbot.
So if i run the example, it works! If i want to do anything other than the demo or If i copy and paste the code into a single "block", it throws a tuple index out of error when trying to use a controller for movement. This is with the correct index set and tried with 3 controllers. Can someone explain why? I mean its the EXACT same code... if it runs the block and then runs the next block, if i make just one block with all the code, it should still work. Am i missing something?
from jetbot.
How to unlink after successfully linking?
from jetbot.
Related Issues (20)
- Issue running enable.sh with Docker
- Waveshare Jetbot
- Update Jetson Nano from Python Version 3.6.9 to 3.9.7 HOT 1
- Jim
- Failed to import jetbot or jetcam.
- jetbot
- AttributeError: 'NoneType' object has no attribute 'create_execution_context' HOT 3
- Red circle issue in jetbot road following training
- jetson nano doesnt boot with jetbot based on jetbot 4.5 HOT 1
- timeout error robot=robot()
- Python 3.8 or 3.10.9 in Jetbot
- communication with motor HOT 1
- Having trouble booting jetbot image (lots of details in the description) HOT 1
- Release with JetPack 4.6?
- Attention states to use JetPack 4.5, but link is to JetPack 4.6
- Jypter lab wont load after logging in HOT 1
- After setup cui is showing Diffferent setup
- Jetbot Module Not Found HOT 1
- Got error when I try to start camera using qt HOT 1
- Report a code error in the data_collection_gamepad.ipynb file in notebooks/road_following folder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jetbot.