Teleoperation Notebook Gamepad Index # for Logitech F710

I successfully connect this gamepad to the Jetbot Nano at /dev/input/js0 as indicated by running “jstest” and “jstest-gtk” (I installed this myself). However running the Teleoperation Notebook with index (1), no action, presumably due an incorrect index.

So what is the correct index # for this frequently referenced Logitech F710? It shows up in the https://html5gamepad.com webpage running on the Nano as “Logitech Wireless Gamepad F710(Standard GAMEPAD Vendor 046d Product c21f”. the Product c21f does not appear in list of popular controllers and searching more than 40 pages is tedious.

Also, I didn’t observe any index # referred to in the Line 3 from the Teleoperation Notebook instructions, here:

  1. Visit http://html5gamepad.com.
  2. Press buttons on the gamepad you’re using
  3. Remember the index of the gamepad that is responding to the button presses

It would be helpful to have a simple utility that displays a gamepad’s index?

I found an HTML Gamepad information page, https://gamedevelopment.tutsplus.com/tutorials/using-the-html5-gamepad-api-to-add-controller-support-to-browser-games--cms-21345

This webpage includes a html5 code demo that inspects, the first gamepad, and prints out the ID (the name of the gamepad) and then the buttons and axes. it reveals that the Logitech F710 ID is “Xbox 360 Controller (XInput STANDARD GAMEPAD)”, the one at the top of the list of popular gamepads. The “Index” simply determine which numbered controller it is. With 1 gamepad connected i.e.Player 1, the Index=1.

Which leaves me with the issue that my Nano Jetbot teleoperation Notebook does not find my Logitech F710 Gamepad, or 2 others I have, even though running https://html5gamepad.com in a Chrome browser on the Nano Desktop finds this gamepad. Suggestions to troubleshoot?

This depends on your settings for the Logitech F710. There is a switch on the “back” of the controller (between the triggers) which selects between Direct Input (D) and Xbox Input (X). The default Jetson Nano image does not have the modules installed for Direct Input support (this requires the setting CONFIG_LOGIRUMBLEPAD2_FF and associated settings in the .config file). These modules make the F710 act like a Logitech Rumble Pad 2.

The Xbox compatible mode is in the default Nano image. You should be able to set the switch to ‘X’ and then see the ‘Standard Gamepad’ work on the website you mentioned. You should set the controller to ‘X’ before booting the machine and detecting the gamepad.

Hi and appreciate your response and would like your further comments on my diagnosis action here, and suggest possible troubleshooting steps.

Right from the start, the Logitech F710 was set for “X” out of the box. Rebooting the Nano Jetson and the usual updates, sudo apt-get update, upgrade, list-upgrade, and "rsync jetbot/notebooks ~/Notebooks did not appear to enable the gamepad in the Notebook. I also checked lsusb and dmesg, as follows, that shows the Gamepad appears to be collected to Ubuntu.

jetbot@jetbot:~ lsusb Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bus 001 Device 006: ID 046d:c21f Logitech, Inc. F710 Wireless Gamepad [XInput Mode] Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub jetbot@jetbot:~ dmesg | grep gamepad
jetbot@jetbot:~ dmesg | grep Logitech [ 9.024635] usb 1-2.2: Manufacturer: Logitech [ 9.142803] usb 1-2.4: Product: Logitech Cordless RumblePad 2 [ 9.142806] usb 1-2.4: Manufacturer: Logitech [ 9.145635] hid-generic 0003:046D:C22F.0004: hidraw0: USB HID v1.11 Device [Logitech Logitech Cordless RumblePad 2] on usb-70090000.xusb-2.4/input0 [ 9.147602] hid-generic 0003:046D:C22F.0005: hidraw1: USB HID v1.11 Device [Logitech Logitech Cordless RumblePad 2] on usb-70090000.xusb-2.4/input1 [ 9.976788] logitech-djreceiver 0003:046D:C52B.0003: hidraw2: USB HID v1.11 Device [Logitech USB Receiver] on usb-70090000.xusb-2.2/input2 [ 10.149106] input: Logitech K400 Plus as /devices/70090000.xusb/usb1/1-2/1-2.2/1-2.2:1.2/0003:046D:C52B.0003/0003:046D:404D.0006/input/input2 [ 10.195240] logitech-hidpp-device 0003:046D:404D.0006: input,hidraw3: USB HID v1.11 Keyboard [Logitech K400 Plus] on usb-70090000.xusb-2.2:1 [ 15.416493] usb 1-2.4: Manufacturer: Logitech [ 15.418012] input: Logitech Gamepad F710 as /devices/70090000.xusb/usb1/1-2/1-2.4/1-2.4:1.0/input/input3 jetbot@jetbot:~

jetbot@jetbot:~ ls -l /dev/input/js* crw-rw-r--+ 1 root input 13, 0 Jul 9 20:05 /dev/input/js0 jetbot@jetbot:~

jstest-gtk app also indicates the F710 is properly connected to /dev/input/js0.

One more thing, running https://html5gamepad.com displays the F710 and proper button and joystick operation. The name is Logitech Wireless Gamepad F710(Standard GAMEPAD Vendor 046d Product c21f. And on the Nano desktop opening in the Chrome Browser: https://gamedevelopment.tutsplus.com/tutorials/using-the-html5-gamepad-api-to-add-controller-support-to-browser-games--cms-21345 has an html Demo that correctly reads the gamepad and displays the Button and Joystick status.:

Gamepad connected!
id: Logitech Wireless Gamepad F710 (STANDARD GAMEPAD Vendor: o4gd Product c21f
Button1…
.
.
Stick 1:0, -0.00000061…
Stick 2:0, -0.00000061…

Here’s the Jupiter Notebook sequence from my Mac Safari Browser connected to the Nano Jetbot:

Create gamepad controller

The first thing we want to do is create an instance of the Controller widget, which we’ll use to drive our robot. The Controller widget takes a index parameter, which specifies the number of the controller. This is useful in case you have multiple controllers attached, or some gamepads appear as multiple controllers. To determine the index of the controller you’re using,

Visit http://html5gamepad.com.
Press buttons on the gamepad you’re using
Remember the index of the gamepad that is responding to the button presses
Next, we’ll create and display our controller using that index.

import ipywidgets.widgets as widgets

controller = widgets.Controller(index=1) # replace with index of your controller

display(controller)

Connect gamepad and press any button.
Even if the index is correct, you may see the text Connect gamepad and press any button. That’s because the gamepad hasn’t registered with this notebook yet. Press a button and you should see the gamepad widget appear above.

*** Nothing happens here***

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)


IndexError Traceback (most recent call last)
in
4 robot = Robot()
5
----> 6 left_link = traitlets.dlink((controller.axes[1], ‘value’), (robot.left_motor, ‘value’), transform=lambda x: -x)
7 right_link = traitlets.dlink((controller.axes[3], ‘value’), (robot.right_motor, ‘value’), transform=lambda x: -x)

IndexError: tuple index out of range
Awesome! Our robot should now respond to our gamepad controller movements. Now we want to view the live video feed from the camera!

The following Notebook cells that show the Camera image work correctly

What number do you set your index? Is the index 0 or 1 based?
This sounds more like an issue with the Jupiter Notebook. I think I misread your original question believing it to say that the gamepad was not detected.

I tried Index=0 and index=1. Neither worked

While I don’t know what the issue might be, it may be helpful to ask the question/issue on the project Github account. An alternative might be to label the question differently so that folks know which project is be referenced, ie JetBot, JetRacer. Teleoperation Notebook might be a little too specific to get the right peoples attention.