18. Misc

18.1. x2go

18.1.1. Fix GLX Issues with rviz2

  1. Install dependencies

    $ sudo apt install libxcb-randr0-dev meson ninja-build byacc flex
    
  2. Enable source code in Additional Drivers and download with

    $ apt-get source mesa
    
  3. Inside the mesa directory execute

    $ mkdir build && cd build && \
    meson -D glx=xlib -D gallium-drivers=swrast -D platforms=x11 -D dri3=false -D dri-drivers="" -D vulkan-drivers="" -D buildtype=release -D optimization=3
    

    and run

    $ ninja
    
  4. Copy libgl-xlib somewhere, e.g. the home directory

    $ sudo cp -r src/gallium/targets/libgl-xlib /
    

To run gazebo or rviz, we need a wrapper. The x2go Wiki proposes two different solutions, where only the latter works for gazebo and rviz.

#!/bin/sh
LD_LIBRARY_PATH="$HOME/libgl-xlib:${LD_LIBRARY_PATH}" exec "$@"

Todo

Check if also the second solution can be added as export in .zshrc.

18.2. Forward Gamepad

$ cat /proc/bus/input/devices | awk '/F710/' RS= | grep -E 'Name=|event[0-9]+'
$ EVENT_DEVICE='dev/input/event2'

Note

Replace the hostname/IP address of the remote target.

$ REMOTE_ADDRESS='XXX.XXX.XXX.XXX'
$ REMOTE_USER='remote_user_name'
$ python -u ~/input-over-ssh/input_over_ssh/client.py -p ${EVENT_DEVICE} | ssh ${REMOTE_USER}@${REMOTE_ADDRESS} -t 'bash -c "python3 -u ~/input-over-ssh/input_over_ssh/server.py"'

On the remote target you can start the joy node.

$ ros2 run joy joy_node --ros-args -p device_name:='Logitech Gamepad F710 (via input-over-ssh)'

Note

For some reason it takes very long (up to a minute) for the joy node to detect the joystick device.

We can expect the node to publish messages as soon as it ouputs the following line:

[INFO] [...] [joy_node]: Opened joystick: Logitech Gamepad F710 (via input-over-ssh).  deadzone: 0.050000