Imported from GitHub: ItzJannis/CoRoSoN-Package_Draft · commit 5bca6fb · license GPL-3.0
Description
Draft version to the official CoRoSoN-Kit.
README
CoRoSoN-Package Draft
Co|mponents for
Ro|bocupJunior
So|ccer
N|ewcomers
Project: CoRoSoN-Kit
Competition: RoboCup
Author: BohleBots
Description
This project offers a draft version to the official CoRoSoN-Kit to provide the fundamental building blocks for a fully functional robot participating in the Soccer Junior division of the RoboCup.
The purpose is to allow for an newcomer friendly entry to the competition by wrapping the essential functions with easy to use APIs. Board designs are designed to be rebuild easily and affordable.
Feel free to reach out to us for questions, feedback, suggestions or constructive critism!
See you in the competition!
Disclaimer
The software and the hardware designs are developed to the best of our knowledge to serve the intented purpose, but may still contain faults. Our software and hardware are provided "as is" and do not provide any warranty. The risk of using it and all neccessary servicing, repair and correction as well as their cost is with you.
Makefile
Using the Arduino IDE or arduino-cli requires all source for a .ino sketch to be inside the sketch folder or inside the libaries directory of the Arduino installation.
Therefore source files inside Software/Shared or Software/Peripheral, that are not located directly next to a .ino sketch, cause problems.
To allow for easy compatibility of this project with Arduino the Makefile was created.
It automates the generation of valid Arduino sketch folders, such that they can be opened in the Arduino IDE or used with arduino-cli.
The Makefile does not require all source files to be inside the sketch folder, but it requires SketchName.ino to be located inside Software/SketchName/.
Run make inside the home directory of this repo to see all the options.
Software
Requirements
Shared
Software that is not build for a specific board but is shared across different board's software.
CoRoSoN_Util
Providing usefull utility definitions for error handling, initializing data and better debugging.
The enum ERROR_CODE provides bitflags for uniform error handling while DEBUG_PRINT(Variable), DEBUG_ERRORS(Errors) and DEBUG_BLOCK(Message, NumMillis) provide easier debugging via the serial connection and the MIN(X,Y), MAX(X,Y), ABS(X), ARRAY_LENGTH(Arr), ZEROMEM(Obj) provide function-like macros to handle data without tedious reimplementation of often used functionalities.
CoRoSoN_I2C
Providing a simpler, more beginner friendly interface to work with the I2C bus system used in this project.
I2C_Init(), I2C_TestConnection(), I2C_Write() and I2C_ReadBlocking() provide all the functionality a newcomer robot for the competition needs.
Attention:
I2C_ReadBlocking() waits for the answers and is therefore blocking the execution of the program.
Make sure that NumBytes equals the length of the passed byte array!
CoRoSoN_Vector
Providing class Vector to easily compute vectorial calculations with functions and operator overloading.
CoRoSoN_Config
This file defines the hardware configuration (namely the pins) for the software.
Main
Software that is supposed to be used on the mainboard.
CoRoSoN_Main
The definitions of enum COLOR, enum SIDE, enum I2C_ADD_BTNLED_MODULE, enum MOTOR and enum DIRECTION are used to firstly make software better readable for newcomers and secondly somehow restrict inputs to reduce buggy behavior due to occasionally wrong inputs.
CoRoSoN_Init(), CoRoSoN_SetLEDColor(), CoRoSoN_ButtonIsPressed() and CoRoSoN_SetMotor() provide a beginner friendly API to setting the mainboard up in the setup() of an arduino program as well as reading and writing the mainboards pins.
Peripheral
Software that is supposed to be used on the mainboard to make use of the peripheral devices.
CoRoSoN_Eeprom
Providing an interface to the ESP32's eeprom which is easy to use.
The eeprom is very usefull to save backup data about the current program state (i.e. the robot is enabled to drive) in case of a shutdown or a reset for whatever reason.
The struct EEPROM_DATA can be filled with whatever you want to read / write from the eeprom.
EEPROM_Init(), EEPROM_Read() and EEPROM_Write() provide an easy interface that only deals with instances of EEPROM_DATA.
CoRoSoN_Pixy
Providing class Pixy with its Update(), GoalSeen(), OwnGoalSeen(), GoalDirection() and OwnGoalDirection() to make use of the Pixy camera for locating the two goals on the playing field.
In CoRoSoN_Pixy.h set PIXY_VERSION to 1 or 2 according to the version of the Pixy cam in use.
For the directions: <0 represents left, >0 represents right
CoRoSoN_IR-Ring
Providing class IRRing with its Update(), BallSeen(), BallDirection() and BallDistance() to make use of the infrared sensor ring with the firmware running on it (also provided).
For the directions: <0 represents left, >0 represents right, 0 represents front, -32 represents no ball seen
For the distance: 1...32 represents closest...furthest, 0 represents no ball seen
IR
Software that is supposed to be used on the infrared sensor ring.
Firmware_IR-Ring
Providing the firmware that is designed to be loaded onto the infrared sensor ring and making it ready to be used in a plug-and-play manner. \
Software Process / Algorithm
- Read all physical signals
- Remove minimum value from all sensor values (ensuring at least one is 0)
- Use exponential moving average (EMA) for each sensor - the lower
EMA_ALPHA_PERCENTAGE, the more the values are smoothed - Gaussian blur on each sensors value with its 2 neighbouring values -
BLUR_ORIGINAL_VALUE_WEIGHT_PERCENTAGEdefines the weight the middle sensor gets - Exaggerate differences by squaring percentage of maximum value for each sensor
- Expand values to higher resolution by using cubic interpolation
- Giving the sensors close to the last output direction a boost of up to 5% of their current value, to reduce fluctuations
- Find highest value
- Exaggerate differences by squaring percentage of maximum value for each sensor
- Vector addition around highest value for more precise direction -
VECTOR_ADDITION_SENSOR_COUNTdefines the number of vectors involved - Determine distance by numeric integration
- Compute final direction and distance with running median -
RUNNING_MEDIAN_DIRECTION_LENGTHandRUNNING_MEDIAN_DISTANCE_LENGTHdefine the history length for the running medians
Hardware
Main
Contains the KiCad project of the Main PCB.
IR-Ring
Contains the KiCad project of the IR-Ring PCB.
3D_Prints
Contains all the 3D printable designs as .stl files.
CasterBall
Spherical third ground contact point to prevent the robot from falling over due to having only 2 wheels.
Chassis_Base
The base part of the chassis fitting together with the top plate.
Chassis_TopPlate
The main plate enclosing the chassis, also including part of the machanism to hold the battery pack.
Dribbler_Enclosure
Holds the dribbling unit (motor and rotating silicone shell).
Dribbler_Enclosure_EndCap
The end cap to close the enclosure of the dribbling unit.
Dribbler_Mounting
Add-On to the top plate to mount the dribbling unit and support the IR-Ring up on top.
Dribbler_Mounting_short
Shorter version of Dribbler_Mounting.stl in terms of height.
Dribbler_SiliconeRoller
Rotating shell of the dribbling unit, supposed to be covered with silicone.
IR-Ring_Cover
Covers the IR-Ring PCB to reduce external ambient noise for the sensors.
IR-Ring_Cover_Counterpart
Counterpart for the IR-Ring cover such that it is properly fixated.
Main_Frame
Mounting frame for the Main PCB.
Motor_Mounting
Mounting for the 2 motors that move the robot.
Pixy_Mounting
Mounting frame for pixy camera.
WheelCoupling_Direct
Coupling adapter to connect the rotating shell to the motor axis.
WheelCoupling_Insert
Coupling adapter to connect the wheels to the motor axis.
No comments yet. Be the first to ask about this board.