Skip to content

how2flow/ros2_axis6

Repository files navigation

axis6

An ros2 package that uses an odroid to control the six-axis robot arm.

Intro

six-axis test

requirements

hardware

  • Odroid board x1 (N2, C4, M1 ..)
  • robot frame
  • MG996R x 6
  • pca9685: How to Use
  • dip-switch (>= 6)
  • joystick module (KY-023)
  • resister (>= 1k) x 6

develop env

(You must have a separate desktop to use rviz.)

  • kernel 5.15.y (flash odroid ros2 image) N2+ / N2L / C4 / M1
  • ros2-foxy
  • libgpiod (odroid only)
  • adafruit-circuitpython-pca9685 (odroid only)
  • odroid-wiringpi (odroid only)

circuit

six-axis robot

fixups

This is the process since you installed ros2. (odroid only)

Install pip packages

$ sudo python3 -m pip install --upgrade pip
$ sudo python3 -m pip install adafruit-circuitpython-pca9685 \
  adafruit-python-shell click wheel \
  Adafruit-Blinka==8.18.1 \
  adafruit-circuitpython-register \
  adafruit-circuitpython-busdevice

Install libgpiod.py

$ wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/libgpiod.py
$ sudo python3 libgpiod.py # ignore errors

Install libgpiod library

$ git clone https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
$ cd libgpiod
$ git checkout v1.4.2 -b v1.4.2
$ sudo ./autogen.sh --enable-tools=yes --prefix=/usr/local/ --enable-bindings-python CFLAGS="-I/$include_path"
$ sudo make
$ sudo ldconfig
$ sudo cp bindings/python/.libs/gpiod.* /usr/local/lib/python3.?/dist-packages

Each board has a different installation method for the odroid-wirigpi APT package

Install odroid-wiringpi (N2/N2L/C4)

$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:hardkernel/ppa
$ sudo apt update
$ sudo apt install odroid-wiringpi

Install odroid-wiringpi (M1)

$ sudo apt update
$ sudo apt install odroid-wiringpi

After install odroid-wiringpi APT package,
Install odroid-wiringpi pip package.

Install odroid-wiringpi:pip

$ python3 -m pip install odroid-wiringpi

Usage

There are three modes of this package.

If you want to use all three, you can use one desktop with ros2 installed
and one odroid board with ros2 and all requirements installed.

  1. Normal mode:
    robot control with joystick.
    it is default.
    Select(dip-switch) the motor(only one) you want to control, then control it with the joystick.
    If you turn off all dip switches, you become neutral.
    When changing the motor to be controlled, leave it in neutral, and then select the one channel.
    It was in a different mode, to switch to normal mode,
    turn off all dip switches to make them neutral, and then press the joystick.

  2. Display mode:
    When all the dip switches are turned off and push joystick, the display mode is turned on. It can be controlled by rviz2.
    To switch to normal mode, turn off all dip switches to make them neutral, and then press the joystick.

  3. Service mode:
    When the service is called through the 'commander' node, it enters the service mode.
    To switch to a different mode, as I just mentioned, you can either turn off or turn on all of the dip switches and push the joystick.

Usage: build

How to Build:

$ sudo groupadd gpiod --gid {group_id}
$ sudo usermod -aG gpiod $(whoami)
$ git clone --recurse-submodules https://github.com/how2flow/ros2_axis6.git
$ cd ros2_axis6
$ ./preinstall.sh
$ reboot
$ mkdir -p robot_ws/src
$ ln -s ~/ros2_axis6 robot_ws/src
$ ln -s ~/ros2_axis6/how2flow_interfaces ~/robot_ws/src
$ cd ~/robot_ws && colcon build --symlink-install

Usage: run

How to Run:

Node 1. commander

$ ros2 run axis6 commander

Node 2. operator (odroid)

$ ros2 run axis6 operator

Usage: display

View and Contorl prototype in rviz.
Not available on the odroid board.

requirements: ros-foxy-joint-state-publisher-gui

$ ros2 launch display.prototype.py

prototpye-rviz


if you want to control with rviz2,
All dip-switch on and push joystick

youtube

Video Label

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published