Hood NUC ROS2 202004 Notes and Log

From wikidb
Jump to: navigation, search
joy20200407.txt

April 7, 2020

http://emanual.robotis.com/docs/en/platform/turtlebot3/ros2_basic_operation/#ros-2-basic-operation

Section 18.2.3 PS3 joystick

QUICK REF
TERMINALS 1 through 4
source bringup.sh
sudo ds4drv
ros2 run joy joy_node
ros2 run teleop_twist_joy teleop_node

Hold down button "6" (internally 5) and use right controller.
only works for angular z 

joy plugged into hub
eepp@hood:tmp$ lsusb
Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 05e3:0617 Genesys Logic, Inc. 
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 007: ID 8087:07dc Intel Corp. 
Bus 002 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 002 Device 003: ID 0483:5740 STMicroelectronics STM32F407
Bus 002 Device 008: ID 046d:c216 Logitech, Inc. Dual Action Gamepad
Bus 002 Device 006: ID f617:0905  
Bus 002 Device 004: ID 413c:3200 Dell Computer Corp. Mouse
Bus 002 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Joy unplugged into hub
eepp@hood:tmp$ lsusb
Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 05e3:0617 Genesys Logic, Inc. 
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 007: ID 8087:07dc Intel Corp. 
Bus 002 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 002 Device 003: ID 0483:5740 STMicroelectronics STM32F407
Bus 002 Device 006: ID f617:0905  
Bus 002 Device 004: ID 413c:3200 Dell Computer Corp. Mouse
Bus 002 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

This installs pip3    I need pip

eepp@hood:tmp$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.3.0-42 linux-headers-5.3.0-42-generic
  linux-image-5.3.0-42-generic linux-modules-5.3.0-42-generic
  linux-modules-extra-5.3.0-42-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  python-pip-whl python3-wheel
The following NEW packages will be installed:
  python-pip-whl python3-pip python3-wheel
0 upgraded, 3 newly installed, 0 to remove and 264 not upgraded.
Need to get 1,803 kB of archives.
After this operation, 2,611 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 python-pip-whl all 9.0.1-2.3~ubuntu1.18.04.1 [1,653 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 python3-pip all 9.0.1-2.3~ubuntu1.18.04.1 [114 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 python3-wheel all 0.30.0-0.2 [36.5 kB]
Fetched 1,803 kB in 1s (1,849 kB/s)     
Selecting previously unselected package python-pip-whl.
(Reading database ... 297448 files and directories currently installed.)
Preparing to unpack .../python-pip-whl_9.0.1-2.3~ubuntu1.18.04.1_all.deb ...
Unpacking python-pip-whl (9.0.1-2.3~ubuntu1.18.04.1) ...
Selecting previously unselected package python3-pip.
Preparing to unpack .../python3-pip_9.0.1-2.3~ubuntu1.18.04.1_all.deb ...
Unpacking python3-pip (9.0.1-2.3~ubuntu1.18.04.1) ...
Selecting previously unselected package python3-wheel.
Preparing to unpack .../python3-wheel_0.30.0-0.2_all.deb ...
Unpacking python3-wheel (0.30.0-0.2) ...
Setting up python-pip-whl (9.0.1-2.3~ubuntu1.18.04.1) ...
Setting up python3-wheel (0.30.0-0.2) ...
Setting up python3-pip (9.0.1-2.3~ubuntu1.18.04.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...





eepp@hood:tmp$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.3.0-42 linux-headers-5.3.0-42-generic
  linux-image-5.3.0-42-generic linux-modules-5.3.0-42-generic
  linux-modules-extra-5.3.0-42-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libpython-all-dev python-all python-all-dev python-crypto python-dbus
  python-gi python-keyring python-keyrings.alt python-secretstorage
  python-wheel python-xdg
Suggested packages:
  python-crypto-doc python-dbus-dbg python-dbus-doc python-gi-cairo
  libkf5wallet-bin gir1.2-gnomekeyring-1.0 python-fs python-gdata
  python-keyczar python-secretstorage-doc
The following NEW packages will be installed:
  libpython-all-dev python-all python-all-dev python-crypto python-dbus
  python-gi python-keyring python-keyrings.alt python-pip python-secretstorage
  python-wheel python-xdg
0 upgraded, 12 newly installed, 0 to remove and 264 not upgraded.
Need to get 812 kB of archives.
After this operation, 3,807 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libpython-all-dev amd64 2.7.15~rc1-1 [1,092 B]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-all amd64 2.7.15~rc1-1 [1,076 B]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-all-dev amd64 2.7.15~rc1-1 [1,100 B]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-crypto amd64 2.6.1-8ubuntu2 [244 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-dbus amd64 1.2.6-1 [90.2 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python-gi amd64 3.26.1-2ubuntu1 [197 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-secretstorage all 2.3.1-2 [11.8 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-keyring all 10.6.0-1 [30.6 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-keyrings.alt all 3.0-1 [16.7 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 python-pip all 9.0.1-2.3~ubuntu1.18.04.1 [151 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 python-wheel all 0.30.0-0.2 [36.4 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 python-xdg all 0.25-4ubuntu1 [31.3 kB]
Fetched 812 kB in 2s (530 kB/s)        
Selecting previously unselected package libpython-all-dev:amd64.
(Reading database ... 297583 files and directories currently installed.)
Preparing to unpack .../00-libpython-all-dev_2.7.15~rc1-1_amd64.deb ...
Unpacking libpython-all-dev:amd64 (2.7.15~rc1-1) ...
Selecting previously unselected package python-all.
Preparing to unpack .../01-python-all_2.7.15~rc1-1_amd64.deb ...
Unpacking python-all (2.7.15~rc1-1) ...
Selecting previously unselected package python-all-dev.
Preparing to unpack .../02-python-all-dev_2.7.15~rc1-1_amd64.deb ...
Unpacking python-all-dev (2.7.15~rc1-1) ...
Selecting previously unselected package python-crypto.
Preparing to unpack .../03-python-crypto_2.6.1-8ubuntu2_amd64.deb ...
Unpacking python-crypto (2.6.1-8ubuntu2) ...
Selecting previously unselected package python-dbus.
Preparing to unpack .../04-python-dbus_1.2.6-1_amd64.deb ...
Unpacking python-dbus (1.2.6-1) ...
Selecting previously unselected package python-gi.
Preparing to unpack .../05-python-gi_3.26.1-2ubuntu1_amd64.deb ...
Unpacking python-gi (3.26.1-2ubuntu1) ...
Selecting previously unselected package python-secretstorage.
Preparing to unpack .../06-python-secretstorage_2.3.1-2_all.deb ...
Unpacking python-secretstorage (2.3.1-2) ...
Selecting previously unselected package python-keyring.
Preparing to unpack .../07-python-keyring_10.6.0-1_all.deb ...
Unpacking python-keyring (10.6.0-1) ...
Selecting previously unselected package python-keyrings.alt.
Preparing to unpack .../08-python-keyrings.alt_3.0-1_all.deb ...
Unpacking python-keyrings.alt (3.0-1) ...
Selecting previously unselected package python-pip.
Preparing to unpack .../09-python-pip_9.0.1-2.3~ubuntu1.18.04.1_all.deb ...
Unpacking python-pip (9.0.1-2.3~ubuntu1.18.04.1) ...
Selecting previously unselected package python-wheel.
Preparing to unpack .../10-python-wheel_0.30.0-0.2_all.deb ...
Unpacking python-wheel (0.30.0-0.2) ...
Selecting previously unselected package python-xdg.
Preparing to unpack .../11-python-xdg_0.25-4ubuntu1_all.deb ...
Unpacking python-xdg (0.25-4ubuntu1) ...
Setting up python-crypto (2.6.1-8ubuntu2) ...
Setting up python-wheel (0.30.0-0.2) ...
Setting up libpython-all-dev:amd64 (2.7.15~rc1-1) ...
Setting up python-keyrings.alt (3.0-1) ...
Setting up python-gi (3.26.1-2ubuntu1) ...
Setting up python-dbus (1.2.6-1) ...
Setting up python-pip (9.0.1-2.3~ubuntu1.18.04.1) ...
Setting up python-all (2.7.15~rc1-1) ...
Setting up python-xdg (0.25-4ubuntu1) ...
Setting up python-secretstorage (2.3.1-2) ...
Setting up python-keyring (10.6.0-1) ...
Setting up python-all-dev (2.7.15~rc1-1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...




eepp@hood:tmp$ sudo pip install ds4drv
The directory '/home/eepp/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/eepp/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ds4drv
  Downloading https://files.pythonhosted.org/packages/80/dc/1984b76e163fba5639a8650a00616d59db707f8396b713b93d4c2445bdd5/ds4drv-0.5.1-py2.py3-none-any.whl
Collecting evdev>=0.3.0 (from ds4drv)
  Downloading https://files.pythonhosted.org/packages/89/83/5f5635fd0d91a08ac355dd9ca9bde34bfa6b29a5c59f703ad83d1ad0bf34/evdev-1.3.0.tar.gz
Collecting pyudev>=0.16 (from ds4drv)
  Downloading https://files.pythonhosted.org/packages/72/c8/4660d815a79b1d42c409012aaa10ebd6b07a47529b4cb6880f27a24bd646/pyudev-0.22.0.tar.gz (85kB)
    100% |████████████████████████████████| 92kB 3.9MB/s 
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from pyudev>=0.16->ds4drv)
Installing collected packages: evdev, pyudev, ds4drv
  Running setup.py install for evdev ... done
  Running setup.py install for pyudev ... done
Successfully installed ds4drv-0.5.1 evdev-1.3.0 pyudev-0.22.0



TERMINAL 2

eepp@hood:tmp$ 
eepp@hood:tmp$ sudo ds4drv
[info][controller 1] Created devices /dev/input/js1 (joystick) /dev/input/event12 (evdev) 
[info][bluetooth] Scanning for devices


TERMINAL 3

eepp@hood:~$ ll /dev/input/js*
crw-rw-r--+ 1 root input 13, 0 Apr  7 10:13 /dev/input/js0
crw-rw-r--+ 1 root input 13, 1 Apr  7 10:36 /dev/input/js1




eepp@hood:~$ ros2 run joy joy_node
[INFO] [joy_node]: Opened joystick: /dev/input/js0. deadzone_: 0.050000.



TERMINAL 4


eepp@hood:~$ ros2 run teleop_twist_joy teleop_node
[INFO] [TeleopTwistJoy]: Teleop enable button 5.
[INFO] [TeleopTwistJoy]: Linear axis x on 5 at scale 0.500000.
[INFO] [TeleopTwistJoy]: Angular axis yaw on 2 at scale 0.500000.




TERMINAL 5

eepp@hood:~$ rqt_graph 
Gtk-Message: 10:44:27.996: GtkDialog mapped without a transient parent. This is discouraged.
Exception ignored in: <bound method DockWidgetTitleBar.__del__ of <qt_gui.dock_widget_title_bar.DockWidgetTitleBar object at 0x7fc9b84c6ca8>>
Traceback (most recent call last):
  File "/opt/ros/dashing/lib/python3.6/site-packages/qt_gui/dock_widget_title_bar.py", line 109, in __del__
    self._dock_widget.removeEventFilter(self)
RuntimeError: wrapped C/C++ object of type DockWidget has been deleted



eepp@hood:~$ ros2 topic list
/battery_state
/cmd_vel
/imu
/joint_states
/joy
/magnetic_field
/odom
/parameter_events
/robot_description
/rosout
/scan
/sensor_state
/tf
/tf_static


eepp@hood:~$ 
eepp@hood:~$ 
eepp@hood:~$ ros2 topic echo /joy
header:
  stamp:
    sec: 1586281864
    nanosec: 261368786
  frame_id: joy
axes: [-0.0, -0.0, -0.0, -0.0, -0.0, -0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header:
  stamp:
    sec: 1586281864
    nanosec: 311664461
  frame_id: joy
axes: [-0.0, -0.0, -0.0, -0.0, -0.0, -0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header:
  stamp:
    sec: 1586281864
    nanosec: 361925806
  frame_id: joy
axes: [-0.0, -0.0, -0.0, -0.0, -0.0, -0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header:
  stamp:
    sec: 1586281864
    nanosec: 412142971
  frame_id: joy
axes: [-0.0, -0.0, -0.0, -0.0, -0.0, -0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header:
  stamp:
    sec: 1586281864
    nanosec: 462456281
  frame_id: joy
axes: [-0.0, -0.0, -0.0, -0.0, -0.0, -0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header:
  stamp:
    sec: 1586281864
    nanosec: 512735136
  frame_id: joy
axes:


appears to be working

don't like th js1 and js0 discrepancy
rebooting



TERMINALS 1 through 4
source bringup.sh
sudo ds4drv
ros2 run joy joy_node
ros2 run teleop_twist_joy teleop_node


https://ubuntu.com/blog/the-teleop_tools-arrive-in-ros-2-dashing


tool????
rqt 
http://emanual.robotis.com/docs/en/platform/turtlebot3/ros2_basic_operation/
section 18.1 topic monitor

menu Plugins -> item Topics -> Topic Monitor
clossed the left window


https://github.com/FurqanHabibi/joystick_ros2
not installed????