Skip to content

lilywang899/DriverStation-Lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Driver Station

The Driver Station allows you to connect and manage a robot easily by providing an abstraction layer between an application and the network comununications between the robot and the host computer. Using FRC 2020 communication protocol, the program is currently used to control a 6-DOF robotic arm with a Logitech F310 gamepad.

The library is written in C, allowing it to be used in many platforms and/or programming languages (using wrappers).

Credit

This code was originally inspired by FRC-Utilities/LibDS created by [Alex Spataru].

Features

Driver Station implements the following features:

  • Modular design
  • Dynamic protocol loading
  • Integrated event system
  • Joystick handling functions
  • Safety features
  • Abstract-protocol object
  • Cross-platform socket handling

Significant modifications and improvements include:

  • Connecting driver station with a robot agent to reduce load of robot and replace RoboRIO with Raspberry Pi
  • Migrated legacy SDL modules and developed a joystick testing tool to troubleshoot connectivity and proper functionality
  • Implemented dynamic configuration for driver station and robot simulator using YAML and XML files
  • Developed a robot simulator using python to test driver station functionalities for multiple protocols
  • Implemented multi-threaded async socket communication between driver station and robot simulator
  • Used data driven robot behavior testing by storing test data in JSON file and integrating comprehensive log module

Work in progress:

  • Integrate robotic gripper controls into Driver Station
  • Improve GUI display of robot status
  • Utilize more buttons on gamepad for features like homing arm to certain positions, or capturing picture

Project Architecture

'Private' vs. 'Public' members

  • All the functions that a client application would be interested in are located in DS_Client.h.

  • Functions that are used by the protocols to update the state of the LibDS are made available in DS_Config.h. Calling any of the 'setter' functions in DS_Config will trigger an event (which can later be used by the client application).

Protocols

Protocols are encapsulated structures. When a protocol is initialized, it defines its properties and its respective data functions. The different functions of Driver Station will then operate with the data and properties defined by the current protocol.

As with the original Driver Station, protocols have access to the DS_Config to update the state of Driver Station.

The base protocol is implemented in the DS_Protocol structure.

Sockets

Instead of manually initializing a socket for each target, data direction and protocol type (UDP and TCP). Driver Station will use the DS_Socket object to define ports, protocol type and remote targets.

All the logic code is in socket.c, which will be in charge of managing the system sockets with the information given by a DS_Socket object.

Compilation instructions

To compile the project, navigate to the project root and run the following commands

  • qmake
  • make

If your project runs into runtime errors try running make staticlib instead of make

To install compiled library files, and headers to the correct locations in /usr/local, use this command

  • sudo make install

License

This project is released under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published