Coder Social home page Coder Social logo

juanea / ar4_ros_driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ycheng517/ar4_ros_driver

0.0 0.0 0.0 4.87 MB

ROS 2 driver for the AR4 robot arm

License: MIT License

Shell 1.54% C++ 59.35% Python 29.87% CMake 3.26% Dockerfile 5.98%

ar4_ros_driver's Introduction

AR4 ROS Driver

ROS 2 driver of the AR4 robot arm from Annin Robotics. Tested with ROS 2 Iron on Ubuntu 22.04. This is a refresh of ar3_core.

Video Demo:

AR4 ROS 2 Driver Demo

Overview

  • ar_description
    • Hardware description of arm, urdf etc.
  • ar_hardware_interface
    • ROS interface for the hardware driver, built on the ros2_control framework
    • Manages joint offsets, limits and conversion between joint and actuator messages
    • Handles communication with the motor controllers
  • ar_microcontrollers
    • Firmware for the motor controller ie. Teensy
  • ar_moveit_config
    • MoveIt module for motion planning
    • Controlling the arm through Rviz
  • ar_gazebo
    • Simulation on Gazebo

Installation

  • Install ROS 2 Iron for Ubuntu 22.04
  • Clone this repository:
    git clone https://github.com/ycheng517/ar4_ros_driver
  • Install workspace dependencies:
    rosdep install --from-paths . --ignore-src -r -y
  • Build the workspace:
    colcon build
  • Source the workspace:
    source install/setup.bash
  • Enable serial port access if you haven't already done so:
    sudo addgroup $USER dialout
    You will need to log out and back in for changes to take effect.

Firmware Flashing

The Teensy Arduino sketch provided in ar_microcontrollers is compatible with the default hardware. To flash it, follow the same procedure as specified in AR4 Robot Setup.

Running in Docker Container

A docker container and run script has been provided that can be used to run the robot and any GUI programs. It requires an NVIDIA GPU, and the NVIDIA Container Toolkit to be installed. Then you can start the docker container with:

docker build -t ar4_ros_driver .
./run_in_docker.sh

Usage

There are two modules that you will always need to run:

  1. Arm module - this can be for either a real-world or simulated arm

    • For controlling the real-world arm, you will need to run the ar_hardware_interface module
    • For the simulated arm, you will need to run the ar_gazebo module
    • Either of the modules will load the necessary hardware descriptions for MoveIt
  2. MoveIt module - the ar_moveit_config module provides the MoveIt interface and RViz GUI.

The various use cases of the modules and instructions to run them are described below:


MoveIt Demo in RViz

If you are unfamiliar with MoveIt, it is recommended to start with this to explore planning with MoveIt in RViz. This contains neither a real-world nor a simulated arm but just a model loaded within RViz for visualisation.

  • The robot description, moveit interface and RViz will all be loaded in the single demo launch file
    ros2 launch ar_moveit_config demo.launch.py
    

Control real-world arm with MoveIt in RViz

Start the ar_hardware_interface module, which will load configs and the robot description:

ros2 launch ar_hardware_interface ar_hardware.launch.py \
  calibrate:=True

Notes:

  • Calibration is required after flashing firmware to the Teensy board, and power cycling the robot and/or the Teensy board. It can be skipped in subsequent runs with calibrate:=False.
  • Serial port of the Teensy board can be specified with the following launch argument: serial_port:=/dev/ttyACM0.

Start MoveIt and RViz:

ros2 launch ar_moveit_config ar_moveit.launch.py

You can now plan in RViz and control the real-world arm. Joint commands and joint states will be updated through the hardware interface.


Control simulated arm in Gazebo with MoveIt in RViz

  • Start the ar_gazebo module, which will start the Gazebo simulator and load the robot description
    ros2 launch ar_gazebo ar_gazebo.launch.py
    
  • Start Moveit and RViz
    ros2 launch ar_moveit_config ar_moveit.launch.py use_sim_time:=true
    
    You can now plan in RViz and control the simulated arm.

ar4_ros_driver's People

Contributors

ycheng517 avatar ongdexter avatar juanea 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.