agent-system / lecture2019

lecture/homework agent-system 2019
4 stars 5 forks source link

Xbox Joystick is still not available #10

Open zycai2016 opened 5 years ago

zycai2016 commented 5 years ago

Get a problem similar to #8 .

My environment is Ubuntu LTS 18.04 and no Nvidia.

Executed in Terminal as following: ## Terminal 1: ./run_no_gl.sh roslaunch aizuspider_description aizuspider.launch ## Terminal 2: ./exec.sh /my_entrypoint.sh roslaunch choreonoid_joy joy.launch namespace:=AizuSpiderAA device:=/dev/input/js0

As result, Choreonoid can be launched, with Warning: Warning: Input file "__name:=choreonoid" was not processed. Warning: Input file "__log:=/root/.ros/log/88dbdad8-8ab8-11e9-b95c-0028f84c7a1b/choreonoid-4.log" was not processed.

Meanwhile, Terminal 2 has no reaction and no hint was shown.

If possible, please teach me how to solve this problem.

Thanks a lot.

YoheiKakiuchi commented 5 years ago

You can check your game pad with the command.

jstest /dev/input/js0

see https://choreonoid.org/en/manuals/latest/simulation/tank-tutorial/step3.html

Information of your gamepad should be in model id map in the source file. https://github.com/s-nakaoka/choreonoid/blob/master/src/Util/JoystickLinux.cpp#L155-L162

zycai2016 commented 5 years ago

You can check your game pad with the command.

jstest /dev/input/js0

see https://choreonoid.org/en/manuals/latest/simulation/tank-tutorial/step3.html

Information of your gamepad should be in model id map in the source file. https://github.com/s-nakaoka/choreonoid/blob/master/src/Util/JoystickLinux.cpp#L155-L162

Sorry for replying in this late time. I apologize if it should make you annoyed.

I have tried jstest as you mentioned before and have ensured that my Joystick device is XBox 360.

jstest result is: Driver version is 2.1.0. Joystick (Microsoft X-Box 360 pad) has 8 axes (X, Y, Z, Rx, Ry, Rz, Hat0X, Hat0Y) and 11 buttons (BtnA, BtnB, BtnX, BtnY, BtnTL, BtnTR, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR).

And then I tried exec.sh again. This time it returned information like this: [ERROR] [1560094503.951663939]: joystic device not ready!! Device "/dev/input/js0": No such file or directory [AizuSpiderAA/joy_node-1] process has died ...

Would it be better to go on trying game pad mode or turn to other operating method? Since it's still hard for me to read materials in Japanese, any of your suggestion would be strongly appreciated.

YoheiKakiuchi commented 5 years ago

You can try robotsimulation-docker/choreonoid_docker/keyboard_joy.py

it publishes /joy topic from keyboard.

./keyboard_joy.py key_joy:=/AizuSpiderAA/joy

You can use choreography with AizuSpider.

$ ./run.sh choreonoid /choreonoid_ws/src/aizuspider_description/AizuSpider_no_sim.cnoid

You can save created motion and can command that motion to the robot in the simulation.

$ ./exec.sh
$ rosrun aizuspider_description send_trajectory_with_pseq.py -N AizuSpiderAA -F /choreonoid_ws/src/aizuspider_description/aizu_p0.pseq --offset=2.0