Coder Social home page Coder Social logo

devin521314 / agx_sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from agilexrobotics/agx_sdk

0.0 0.0 0.0 18.6 MB

Agilex Robot Platform SDK

License: BSD 3-Clause "New" or "Revised" License

CMake 0.13% C++ 30.75% C 0.43% Makefile 2.87% Shell 0.28% Starlark 0.06% M4 0.09% Python 1.39% HTML 63.90% CSS 0.05% Perl 0.04%

agx_sdk's Introduction

Agilex Robot Platform SDK

GitHub Workflow Status GitHub Workflow Status

Copyright (c) 2020 AgilexRobot

Introduction

Supported platforms

  • Scout: skid-steer mobile base
  • Hunter: ackermann mobile base
  • Bunker: caterpillar mobile base
  • Tracer: skid-steer mobile base
  • Scout-mini: skid-steer mobile base

This software packages provides a C++ interface to communicate with the mobile platforms from Agilex Robot, for sending commands to the robot and acquiring the latest robot state. The SDK works on both x86 and ARM platforms.

Generally, you only need to instantiate an object of the robot base class (such as ScoutBase), then use the object to programmatically control the robot. Internally, the base class manages two background threads, one to process CAN/UART messages of the robot state and accordingly update state variables in the robot state data structure, and the other to maintain a 50Hz loop and send the latest command to the robot base. User can iteratively perform tasks in the main thread and check the robot state or set control commands.

Refer to "src/apps" for examples.

Hardware Interface

Setup CAN-To-USB adapter

  1. Enable gs_usb kernel module
    $ sudo modprobe gs_usb
    
  2. Bringup can device
    $ sudo ip link set can0 up type can bitrate 500000
    
  3. If no error occured during the previous steps, you should be able to see the can device now by using command
    $ ifconfig -a
    
  4. Install and use can-utils to test the hardware
    $ sudo apt install can-utils
    
  5. Testing command
    # receiving data from can0
    $ candump can0
    # send data to can0
    $ cansend can0 001#1122334455667788
    

Two scripts inside the "./scripts" folder are provided for easy setup. You can run "./setup_can2usb.bash" for the first-time setup and run "./bringup_can2usb.bash" to bring up the device each time you unplug and re-plug the adapter.

Setup UART

Generally your UART2USB cable should be automatically recognized as "/dev/ttyUSB0" or something similar and ready for use. If you get the error "... permission denied ..." when trying to open the port, you need to grant access of the port to your user accout:

$ sudo usermod -a -G dialout $USER

You need to re-login to get the change to take effect.

Build SDK

Install dependent libraries

$ sudo apt install build-essential cmake
$ sudo apt install libasio-dev

I. Use the package with ROS

$ cd <your-catkin-ws>/src
$ git clone https://github.com/agilexrobotics/agx_sdk.git
$ cd ..
$ catkin_make

II. Use the package without ROS

You will need to upgrade CMake to a newer version in this case. Follow instructions on this page: https://apt.kitware.com/

Here is a brief summary

$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget
$ wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null

Ubuntu 20.04

$ sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'

Ubuntu 18.04

$ sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'

Ubuntu 16.04

$ sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
$ sudo apt-get update
$ sudo apt-get install kitware-archive-keyring
$ sudo rm /etc/apt/trusted.gpg.d/kitware.gpg
$ sudo apt-get install cmake

If you want to build the TUI monitor tool, additionally install libncurses

$ sudo apt install libncurses5-dev

Configure and build

$ cd agx_sdk 
$ mkdir build
$ cd build
$ cmake ..
$ make

Run Demo Apps

Run Scout Demo

The demo code expects one parameter for the CAN bus mode.

$ ./app_scout_demo can0

Both the port name and baud rate need to be provided when using the RS232 interface.

$./app_scout_demo /dev/ttyUSB0 115200

If you've installed "libncurses5-dev" and built "app_scout_monitor", you can run it in a similar way:

$ ./app_scout_monitor can0

or

$./app_scout_monitor /dev/ttyUSB0 115200

Both the port name and baud rate need to be provided when using the RS232 interface.

Run Hunter Demo

The demo code expects one parameter for the CAN bus mode.

$ ./app_hunter_demo can0

Note: the monitor app is not built by default if you use this SDK with ROS.

Known Limitations

Reference

agx_sdk's People

Contributors

agilexrobotics avatar doulong3 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.