Skip to content

A GoLang real-time controller API for robotic systems via CAN

Notifications You must be signed in to change notification settings

UniCT-ARSLab/go-robot-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RobotController (Service) by ARSLab

This is a service for monitoring and controlling robotic systems. It is based mainly on CAN communication to send commands or read information directly from the robot unit control. The service also provides a series of HTTP Rest API with which to execute the same commands and a Websocket (pure or via Socketio) with which to interact in realtime with the robot.

Requirements

The service is written in GoLang version >=1.15, then to be compiled you must have almost this version installed in your machine.

Tests

The service was tested into a Raspberry PI 3 with Raspian (debian linux based) with a CAN board which is used to communicate with the robot system. In addition, the service was used to develop a useful tool to display and interact with the robot in a virtual environment.

Installation

  • Install GoLang (1.15)
  • Install the statik lib (go get -u github.com/rakyll/statik)
  • Run the make install-dep command
  • Run the make build-ui command

Build and Run

Execute the command make build to build the final binary and make run to execute it (or execute directly the binary file).

Project Structure and Description

The service is written in GoLang, therefore there are no concepts such as classes or objects (such as in c). The real "main" file is inside of cmd directory. There are created the robot instance, the webserver and the main loop (an empty loop).

Models

In this directory you can find all structs that rappresent every payload/message or "object" structure.

Robot

In this directory are defined the connection struct with its functions and the robot struct. In the robot struct are defined all commands to be send to the connection throught the connection instance.

Webserver

In this directory is defined the webserver struct and its functions. When a webserver is created (with a robot pointer instance, address and port) the http routes and websocket server are defined.

Utilities

Some struct and fuctions created as utilities.

TODOs

  • Allowing the run of the service with a virtual robot instance.
  • Fix the set_position operation in the robot struct.
  • Create a WebUI to send and controll the local robot instance.
  • Other...

About

A GoLang real-time controller API for robotic systems via CAN

Resources

Stars

Watchers

Forks

Packages

No packages published