-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,58 @@ | ||
# pera-swarm [![npm (scoped)](https://img.shields.io/npm/v/@pera-swarm/pera-swarm.svg)](https://github.com/Pera-Swarm/pera-swarm/) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Pera-Swarm/pera-swarm/%F0%9F%9A%80%20Release)](https://github.com/Pera-Swarm/pera-swarm/releases) [![GitHub issues](https://img.shields.io/github/issues/Pera-Swarm/pera-swarm)](https://github.com/Pera-Swarm/pera-swarm/issues) | ||
A generalized, efficient, and flexible JavaScript library for building swarm robotics simulators. | ||
|
||
### To-Do | ||
- [ ] Add documentation | ||
- [ ] Add algorithms. | ||
- [ ] Configure test suites. | ||
## Overview | ||
*pera-swarm* is a library for building swarm robotic simulators using *Node.js*. This library provides an extensive number of generalized and abstract implementations for related entities (including entities like robot, sensor, coordinate, etc...) for virtual applications associated with not only swarm robotics, but also multi-robotic experiments as well. | ||
|
||
### Usage | ||
#### 1. Installation | ||
Installation done using `npm install` command: | ||
``` | ||
$ npm i --save pera-swarm | ||
``` | ||
|
||
#### 2. Create entities | ||
You can create generalized entity instances: "VRobot" | ||
|
||
##### index.js | ||
``` | ||
const { VRobot, Coordinate, validateCoordinate, ColorSensor } = require('pera-swarm'); | ||
// Sample Robot instance with an id of 1 | ||
const robot = new VRobot(1); | ||
console.log(robot.id); | ||
console.log(robot.coordinates); | ||
console.log(robot.sensors); | ||
console.log(robot.created); | ||
console.log(robot.timestamp); | ||
console.log(robot.updated); | ||
console.log(robot.getSensorReadings(['color', 'distance', 'compass'])); | ||
// compass sensor implementation is not available yet :-) | ||
// Sample Coordinate instance with an id of 1 | ||
const coordinate = new Coordinate(1); | ||
console.log(coordinate.id); | ||
console.log(coordinate.values); | ||
console.log(validateCoordinate(coo)); | ||
coordinate.reset(); | ||
// Sample Color Sensor with an id of 1 | ||
const colorSensor = new ColorSensor(1); | ||
console.log(colorSensor); | ||
console.log(colorSensor.id); | ||
console.log(colorSensor.value); | ||
console.log(colorSensor.getReading()); | ||
``` | ||
|
||
### Documentation | ||
All the entities should initiated with and `id` parameter. You can use the generic implementations or you can create your own implementation by just extending the generic class types for specific use-cases. | ||
|
||
You can find more information about *pera-swarm* on the [*Official Documentation Page*](https://pera-swarm.ce.pdn.ac.lk/docs/). | ||
|
||
### Contribute | ||
|
||
### Licence | ||
This project is licensed under [MIT Licence](https://github.com/Pera-Swarm/pera-swarm/blob/main/LICENSE). |