Skip to content

t-Zeta/joystick_ros2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

joystick_ros2 🎮

Use joypad to teleop your robot in ROS2

How to launch

To launch the joystick package, you can place those lines in the launch file of your personal package.

def generate_launch_description():
        pkg_path_joy = os.path.join(get_package_share_directory('joystick_ros2'))
		
        # Control robot using joystick
        teleop_joy = GroupAction(
                        actions=[
    
                            SetRemap(src='/cmd_vel',dst='/your_robot_name/cmd_vel_unstamped'),
    
                            IncludeLaunchDescription(
                                PythonLaunchDescriptionSource(pkg_path_joy + '/launch/joystick.launch.py'),
                            )
                        ]
                    )           
        
    
        
    
        return LaunchDescription([
            #other nodes, 
            teleop_joy,
             
        ])`

Remapping

To remap the joystick buttons you can modify joystick.yaml. Numbers after x and yaw under axis_linear and axis_angular are the joystick buttons ID (to listen them use /joy topic).

About

Use joypad to teleop your robot in ROS2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published