Git Product home page Git Product logo

minimec-ros2's Introduction

minimec-ros2

The minimec is a custom mecanum wheel base made for development. This repository contains a simple C++ library and ROS2 packages that make the software running on the robot.

Although this was purposely done for the Minimec, I tried to keep the software decoupled from the hardware. A user could ideally swap out the minimec_driver package for one that implements communication with their own hardware and still have mostly everything working.

Packages

  • minimec_bringup - necessary launchfiles and configuration to get the minimec up and running quickly.
  • minimec_control - all things controls. Kinematics, odometry, path generation, trajectory tracking.
  • minimec_description - robot definition, URDF, meshes.
  • minimec_driver - interface with motion hardware (odrives). Although the odrive-provided nodes are used to communicate with the odrives over CAN, this provides an extra layer of abstraction.
  • minimec_msgs- custom messages and services for minimec operation.
  • minimec_lights - control of Neopixel LEDs mounted on the minimec.

Each package contains a README that goes into more detail.

minimeclib - a C++ simple kinematics library for mecanum wheel robots

The MecanumDrive class is the core of this library.

It provides the following functions:

  • FKin - Forward kinematics, maps wheel positions to transforms.
  • IKin - Inverse kinematics, maps input twist to wheel speeds.
  • setWheelOffsets - set initial encoder offsets

ROS2 architecture

image

Four nodes form the odrive_can package communicate the onboard computer with the Odrives. The minimec_driver node serves as a hardware abstraction node, publishing and subscribing to commands and encoder feedback. The odometry node calculates odometry based on the Odrives' feedback. The trajectory_tracker tracks a path using Feedforward + PI control, outputting velocity commands. The kinematics node translates velocity commands into speeds needed by the Odrives. The minimec_lights controls the LEDs based on /cmd_vel. The path_generator offers services that let the user generate paths, which will be tracked by the trajectory_tracker.

building

The same workspace should be on the robot and your computer.

Compiling for the robot:

colcon build --cmake-args -DBUILD_TESTING=OFF -DBUILD_ROBOT=ON, the -DBUILD_TESTING flag is optional, but it prevents from compiling tests. Note: cross compilation is recommended, as compilation on the Pi can take quite a bit.

Compiling for the control computer:

colcon build --cmake-args -DBUILD_TESTING=OFF -DBUILD_ROBOT=OFF

Launching the minimec

Make sure the robot and your computer are on the same network, and share the same ROS_DOMAIN_ID.

for teleop

On the robot:

ros2 launch minimec_bringup launch_minimec.launch.py cmd_src:=teleop - this will launch the necessary nodes on the robot, and the robot just listens to the topic /cmd_vel and moves accordingly (no feedback). You can use the teleop_twist_keyboard node to drive the robot around.

On the control computer:

ros2 launch minimec_bringup launch_command.launch.py cmd_src:=teleop - this will launch the teleop node on a separate terminal.

for tracking trajectories

For launching the robot to track paths.

On the robot:

ros2 launch minimec_bringup launch_minimec.launch.py cmd_src:=path - this will additionally launch the trajectory_tracking node. Whenever a path is published, the tracking node will start following.

On the computer:

ros2 launch minimec_bringup launch_command.launch.py cmd_src:=path - this will launch rviz and the path generation node.

Note: be mindful of the current robot location when you run the trajectory tracking. If the robot is too far from the first point in the path, it will try to make the correction pretty quickly.

Refer to the readme in the minimec_control package to see how to use this mode.

setup

A /setup folder is included in this repository to help set up the robot easily and quickly. This is already done, but can serve as reference if there is a need to reflash the robot's storage.

  • Follow the steps in /setup to cofigure the robot.

minimec-ros2's People

Contributors

maxipalay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

carcruz97 jcvikl

minimec-ros2's Issues

replacing odrive with arduino

hi there, noticed that you are using odrive and leave a bit of space in the driver file for others to put their own driver to use on their robot. Can you walk me briefly on how to use arduino instead? Or is there a way to just use my own arduino control package with your package? Thank you

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.