-
Notifications
You must be signed in to change notification settings - Fork 84
Setup virtual keyboard joystick
In order to create a virtual keyboard joystick, we utilize the Python-uinput package (https://github.com/devbharat/python-uinput).
Note: the source repository is only needed temporarily so it can be cloned anywhere
git clone git@github.com:devbharat/python-uinput.git
cd python-uinput
python setup.py build
sudo python setup.py install
You must have the uinput kernel module loaded to use Python-uinput. To load the module, run:
modprobe -i uinput
Next, we need to allow programs access to the uinput device:
cd udev-rules
sudo cp 40-uinput.rules /etc/udev/rules.d
You might have to restart the machine for the new permissions to take effect.
If this alone does not solve the permissions issue you might have to add your user account to the uinput group:
sudo addgroup uinput
sudo adduser $USER uinput
Once again, restart the machine for the new permissions to take effect.
To test if everything is working properly, run the command below and verify that the virtual keyboard joystick GUI is running, with bars for throttle/roll/pitch/yaw, and responds to keyboard strokes when active:
rosrun rotors_joy_interface key_joystick.py
Once everything is working properly, the cloned Python-uinput repo can be removed.
Depending on your ROS configuration, you might have to install the joystick package:
sudo apt-get install ros-kinetic-joy
Where 'kinetic' would be changed to your distribution of ROS if different
Once all the components are installed and configured, run the following launch file to use CrazyS with the virtual joystick:
roslaunch rotors_gazebo mav_with_keyboard.launch
You might have to un-pause the simulation to be able to fly.
The package also provides a launch file for piloting the Crazyflie using a PC joystick. To run the simulation simple copy and paste the command in the following in a terminal window
roslaunch rotors_gazebo crazyflie2_with_joy.launch
How to add
How to create
- Creating ROS Plugins for Gazebo
- Gazebo and Gazebo ROS Installation
- Gazebo Topic Naming Conventions
- ROS Interface Plugin
- Setup virtual keyboard joystick
How to install
How to generate
How to set
- Setting up CrazyS as Fixed Wing HiL Simulation (Pixhawk, Mavros, Mavlink, QGC)
- Setting up the CrazyS Simulator
How to develop
- Include ordering in cpp and header files
- Interfacing CrazyS through MATLAB
- Interfacing CrazyS with TravisCI
- Interfacing CrazyS with GitHub Action
- Package Versioning
- Software Specifications
- Specifying constants and default values
- Working With Meshes in Gazebo
More information