Git Product home page Git Product logo

amrmohamed96 / motion_control Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 35 KB

A ROS package that handles quadrature encoders and motors. The Repository has a driver for motor that accepts input from (-100,100) treating the negative input as reverse direction. The repository contains a PID controller to stabilize motor velocities and drive the robot in a straight line.

CMake 26.16% Python 73.84%

motion_control's Introduction

Motion Control

This ROS package contains simple yet mandatory scripts to move a differential mobile robot.

Motor Driver

The motor driver script uses 6 wire, 2 PWM mode to drive two motors through an H-bridge. It subscribes to two power motor topics:

rmotor_pwr_rob1
lmotor_pwr_rob1

Encoders

The encoders script interfaces with quadrature encoders, calculates distances covered by each wheel and the velocities of each wheel

Distance are published on the topics:

rwheel_dist_rob1
lwheel_dist_rob1

Velocities are published on the topics:

rwheel_spd_rob1
lwheel_spd_rob1

The topics need to have a value from -100,100 as a duty cycle for the motor. The script handles the negative input as a reversing direction

Twist To Motors

It then transforms the twist message into required wheel velocities by using the base width as w in the beginning of the script The script subscribes to a twist message on the following topic

cmd_vel_rob1

Velocity PID

The velocity pid script is a simple pid loop. When running, the output is published to the motor power topics, to which the motor driver is suscribed to. These are:

rmotor_pwr_rob1
lmotor_pwr_rob1

The script subscribes to the wheel velocities topics to run the pid algorithm:

rwheel_spd_rob1
lwheel_spd_rob1

Diff_TF

The odometry script subscribes to wheel velocities and distances, and then publishes the current position of the robot on:

CurrentPosition_rob1

motion_control's People

Contributors

amrmohamed96 avatar

Watchers

James Cloos avatar ibrahim öztürk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.