The robotone_joystick is a ROS2 package that provides Joystick state. It enables users to interact with the robot using an Xbox controller for operation and testing. This package runs only on Linux system.
Key features include:
- Crete Joystick node
- Publish Joystick message (sensor_msgs/msg/joy)
- Configurable joystick interface
Ensure the following dependencies are installed:
- ROS2 (Humble or above)
- Python 3
-
Clone the repository into your ROS2 workspace:
cd ~/ros2_ws/src git clone https://github.com/fra1alv/robotone_joystick.git
-
Build the workspace:
cd ~/ros2_ws colcon build source install/setup.bash
-
Verify the installation by listing available ROS2 packages:
ros2 pkg list | grep robotone_joystick
The robotone_joystick package uses a configuration file to setup an interface with a joystick and process its input, then publishes it joy meassage. The default configuration file is located at config/xbox_config.yaml.
You can customize the parameters by editing this file:
robotone_joystick_node:
ros__parameters:
topic_name: /robotone_joystick
dev: /dev/input/js0
debug: true
autorepeat_rate: 0 #Hz
coalesce_interval: 1 #ms
deadzone: 0.05
- Launch the joystick node:
Note: xBox controller is default in future we might have different controllers.
ros2 launch robotone_joystick robotone_joystick_launch.py
- Verify the node list
Node: you must to find the node robotone_joystick_node
ros2 node list
- List topics published by a node:
ros2 node info /robotone_joystick_node
- Listen to the topic
Note: Topic name can be set on the config file
ros2 topic echo /robotone_joystick
robotone_joystick/
├── config/ # Configuration files
│ └── xbox_config.yaml
├── include/ # header files
│ └── robotone_joystick/
│ └── robotone_joystick.hpp/
├── launch/ # Launch files
│ └── robotone_joystick_launch.py
├── src/ #Source code
│ └── robotone_joystick_node.hpp
│ └── robotone_joystick,cpp
├── CMakeLists.txt
├── LICENSE
├── package.xml # ROS2 package manifest
└── README.md
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the GPLv3 License.
For support or questions, feel free to reach out:
- Email: alonsofra1alv@gmail.com
- GitHub: Fra1alv