[Documentation] [TitleIndex] [WordIndex

Only released in EOL distros:  

Package Summary

Provides some basic tools for interfacing a differential-drive robot with the ROS navigation stack. The intent is to make this independent of specific robot implementation.

Package Summary

Provides some basic tools for interfacing a differential-drive robot with the ROS navigation stack. The intent is to make this independent of specific robot implementation.

Github Source: https://github.com/jfstepha/differential-drive

Tutorials

  1. Setting up the differential_drive package PID controller

    This tutorial goes through setting up the differential_drive package and tuning the PID parameters

  2. Hacked K'nex robot using differential_drive

    This tutorial is just a link to the Hacked K'nex tutorials on google code.

  3. Installing the differential_drive package

  4. URDF setup for differential_drive

    Setting up the differential_drive package URDF and transforms

Summary

When I started my robot project, I was surprised to find there was no basic differential drive package. There were stacks that implemented differential drive, but they were very closely coupled with the hardware driver. This package is an attempt to implement some of the basic functions in a robot-independent way.

The purpose of this package is to provide an interface to the navigation stack. It takes in a twist message from the navigation stack, and provides a lwheel and rwheel messages to be used as motor driver strengths. The package receives wheel encoder messages back from the hardware and generates the tf transform messages required by the ROS navigation stack.

See also the knex-ros page for an example hacked K'nex robot.

This package provides the following nodes:

The image below shows how the nodes relate to one another. See the knex_ros package for an example implementation of the hardware drive with an arduino as well as an attempt at a low-cost alternative to a laser scanner.

overview

Requirements

The differential_drive package requires the following:

ROS API

diff_tf

Published Topics

odom - (nav_msgs/Odometry)

tf -

Subscribed Topics

lwheel (std_msgs/Int16)

rwheel (std_msgs/Int16)

Parameters

~rate (float, default:10)

ticks_meter (int, default:50)

~base_width (float, default:0.245)

~base_frame_id (string, default:"base_link")

~odom_frame_id (string, default:"odom")

encoder_min (int, default:-32768)

encoder_max (int, default: 32768)

wheel_low_wrap (int, default: 0.3 * (encoder_max - encoder_min) + encoder_min

wheel_high_wrap (int, default: 0.7 * (encoder_max - encoder_min) + encoder_min

pid_velocity

pid_velocity is a PID controller using feedback from a rotary encoder to the wheel power to control the velocity of the robot wheel. A typical differential drive setup will have 2 of these PID velocity controllers, one for each wheel.

Published Topics

motor_cmd (Float32)

wheel_vel (Float32)

Subscribed Topics

wheel (Int16)

wheel_vtarget (Float32)

Parameters

~Kp (float, default:10)

~Ki (float, default:10)

~Kd (float, default:0.001)

~out_min (float, default: -255)

~out_max (float, default: 255)

~rate (float, default: 30)

~rolling_pts (float, default: 2)

~timeout_ticks (int, default: 2)

ticks_meter (float, default: 20)

vel_threshold (float, default: 0.001)

encoder_min (int, default:-32768)

encoder_max (int, default: 32768)

wheel_low_wrap (int, default: 0.3 * (encoder_max - encoder_min) + encoder_min

wheel_high_wrap (int, default: 0.7 * (encoder_max - encoder_min) + encoder_min

twist_to_motors

twist_to_motors translates a twist message into velocity target messages for the two motors. The velocity target messages are published at a rate of ~rate hertz as long as twist messages are being recieved, and ~timeout_ticks ticks after the messages stop.

Published Topics

lwheel_vtarget - (std_msgs/Float32)

rwheel_vtarget - (std_msgs/Float32)

Subscribed Topics

twist - (geometry_msgs/Twist)

Parameters

~base_width - (float, default:0.1)

~rate - (int, default:50)

~timeout_ticks - (int, default:2)

virtual_joystick

This node does pretty much the same thing as the RVIZ add-in panel, except it has an adjustable range for the velocities.

Published Topics

twist (Twist)

Subscribed Topics

none

Parameters

~publish_rate

~x_min (float, default:-1.50)

~x_max (float, default: 1.50)

~r_min (float, default:10.0)

~r_max (float, default:10.0)


2022-05-28 12:33