This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
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.
Conflicts: ia/hokuyo.class.js webclient/index.js webclient/pages/orders/orders.js
- Loading branch information
Showing
73 changed files
with
2,349 additions
and
844 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
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 |
---|---|---|
@@ -0,0 +1,169 @@ | ||
/** | ||
* Module exportant la classe abstraite Asserve | ||
* | ||
* @module clients/Asserv/Asserv | ||
*/ | ||
|
||
"use strict"; | ||
|
||
/** | ||
* Class Asserv. | ||
* | ||
* @memberof module:clients/Asserv/Asserv | ||
*/ | ||
class Asserv{ | ||
/** | ||
* Creates an instance of Asserv. | ||
* @param {any} client | ||
* @param {any} who | ||
* @param {any} fifo | ||
*/ | ||
constructor(client, who, fifo){ | ||
/** @type {Log4js} */ | ||
this.logger = require('log4js').getLogger('asserv'); | ||
|
||
/** @type {Object} */ | ||
this.client = client; | ||
|
||
/** @type {Object} */ | ||
this.who = who; | ||
|
||
/** @type {Object} */ | ||
this.pos = {}; | ||
|
||
/** @type {clients/fifo.Fifo} */ | ||
this.fifo = fifo; | ||
} | ||
|
||
/** | ||
* Convert Angle | ||
* | ||
* @param {int} a Angle | ||
*/ | ||
// Attention, c'est une fonction a la base, pas une methode | ||
convertA(a) { return Math.atan2(Math.sin(a), Math.cos(a)); } | ||
|
||
/** | ||
* Set Angle | ||
* | ||
* @param {int} a Angle | ||
*/ | ||
setA(a) { | ||
this.pos.a = convertA(a); | ||
} | ||
|
||
/** | ||
* Position ? | ||
* | ||
* @param {Object} pos | ||
*/ | ||
Pos(pos) { | ||
this.pos.x = pos.x; | ||
this.pos.y = pos.y; | ||
this.setA(pos.a); | ||
} | ||
|
||
/** | ||
* Sets Position | ||
* | ||
* @param {Object} pos | ||
* @param {Object} callback | ||
*/ | ||
setPos(pos, callback){} | ||
|
||
/** | ||
* Gets Position | ||
* | ||
* @param {Object} pos | ||
*/ | ||
getPos(pos) { | ||
this.client.send('ia', this.who+'.getpos'); | ||
} | ||
|
||
|
||
/** | ||
* Sends Position | ||
*/ | ||
sendPos() { | ||
this.client.send('ia', this.who+'.pos', this.pos); | ||
} | ||
|
||
/** | ||
* Calage X | ||
* | ||
* @param {int} x | ||
* @param {int} a Angle | ||
* @param {Object} callback | ||
*/ | ||
calageX(x, a, callback){} | ||
|
||
/** | ||
* Calage Y | ||
* | ||
* @param {int} y | ||
* @param {int} a Angle | ||
* @param {Object} callback | ||
*/ | ||
calageX(y, a, callback){} | ||
|
||
/** | ||
* Set Vitesse | ||
* | ||
* @param {int} v Speed | ||
* @param {float} r Rotation | ||
* @param {Object} callback | ||
*/ | ||
setVitesse(v, r, callback){} | ||
|
||
/** | ||
* Speed ? | ||
* | ||
* @param {int} l | ||
* @param {int} a Angle | ||
* @param {int} ms | ||
* @param {Object} callback | ||
*/ | ||
speed(l, a, ms, callback){} | ||
|
||
/** | ||
* Pulse Width Modulation | ||
* | ||
* @param {int} left | ||
* @param {int} right | ||
* @param {int} ms | ||
* @param {Object} callback | ||
*/ | ||
pwm(left, right, ms, callback){} | ||
|
||
/** | ||
* Go X Y | ||
* | ||
* @param {int} x | ||
* @param {int} y | ||
* @param {string} sens | ||
* @param {Object} callback | ||
* @param {boolean} no_fifo | ||
*/ | ||
goxy(x, y, sens, callback, no_fifo){} | ||
|
||
/** | ||
* Simu Go Angle | ||
* | ||
* @param {int} a Angle | ||
* @param {Object} callback | ||
* @param {boolean} no_fifo | ||
*/ | ||
goa(a, callback, no_fifo){} | ||
|
||
/** | ||
* Set P I D | ||
* | ||
* @param {int} p | ||
* @param {int} i | ||
* @param {int} d | ||
* @param {Object} callback | ||
*/ | ||
setPid(p, i, d, callback){} | ||
} | ||
|
||
module.exports = Asserv; |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Classe implémentant l'asservissement en mode réel. | ||
* | ||
* @module clients/Asserv/AsservReal | ||
* @requires module:clients/Asserv/Asserv | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const Asserv = require('Asserv.class.js'); | ||
|
||
/** | ||
* Classe implémentant l'asservissement en mode réel | ||
* | ||
* @memberof module:clients/Asserv/AsservReal | ||
* @extends {clients/Asserv/Asserv.Asserv} | ||
*/ | ||
class AsservReal extends Asserv{ | ||
constructor(){ | ||
|
||
} | ||
} | ||
|
||
module.exports = AsservReal; |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Module Asservissement en mode simulateur | ||
* | ||
* @module clients/Asserv/AsservSimu | ||
* @requires module:clients/Asserv/Asserv | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const Asserv = require('Asserv.class.js'); | ||
|
||
/** | ||
* Classe héritant de l'asservissement, mode simulateur | ||
* | ||
* @memberof module:clients/Asserv/AsservSimu | ||
* @extends {clients/Asserv/Asserv.Asserv} | ||
*/ | ||
class AsservSimu extends Asserv{ | ||
constructor(){ | ||
|
||
} | ||
} | ||
|
||
module.exports = AsservSimu; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Module définissant un actuator abstrait | ||
* | ||
* @module clients/Extension/Actuators/actuator | ||
*/ | ||
|
||
"use strict"; | ||
|
||
/** | ||
* Classe abstraite représentant un actuator | ||
* | ||
* @class Actuator | ||
* @memberof module:clients/Extension/Actuators/actuator | ||
*/ | ||
class Actuator { | ||
constructor () { | ||
// | ||
} | ||
} | ||
|
||
module.exports = Actuator; |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Module implémentant un actuator pour l'AX12 | ||
* | ||
* @module clients/Extension/Actuators/ax12 | ||
* @requires module:clients/Extension/Actuators/actuator | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const Actuator = require('actuator.class.js'); | ||
|
||
/** | ||
* Classe implémentant un actuator pour l'AX12 | ||
* | ||
* @class Ax12 | ||
* @memberof clients/Extension/Actuators/ax12 | ||
* @extends {clients/Extension/Actuators/actuator.Actuator} | ||
*/ | ||
class Ax12 extends Actuator { | ||
constructor (){ | ||
// | ||
} | ||
} | ||
|
||
module.exports = Ax12; |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Module implémentant l'actuator pour le servo-moteur | ||
* | ||
* @module clients/Extension/Actuators/servo | ||
* @requires clients/Extension/Actuators/actuator | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const Actuator = require('actuator.class.js'); | ||
|
||
/** | ||
* Classe implémentant l'actuator pour le servo-moteur | ||
* | ||
* @class Servo | ||
* @memberof clients/Extension/Actuators/servo | ||
* @extends {clients/Extension/Actuators/actuator.Actuator} | ||
*/ | ||
class Servo extends Actuator { | ||
constructor () { | ||
// | ||
} | ||
} | ||
|
||
module.exports = Servo; |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Module implémentant l'actuator pour le capteur pas-à-pas | ||
* | ||
* @module clients/Extension/Actuators/stepper | ||
* @requires clients/Extension/Actuators/actuator | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const Actuator = require('actuator.class.js'); | ||
|
||
/** | ||
* Classe implémentant l'actuator pour le capteur pas-à-pas | ||
* | ||
* @class Stepper | ||
* @memberof clients/Extension/Actuators/stepper | ||
* @extends {clients/Extension/Actuators/actuator.Actuator} | ||
*/ | ||
class Stepper extends Actuator { | ||
constructor () { | ||
// | ||
} | ||
} | ||
|
||
module.exports = Stepper; |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Module permettant de construire la base lunaire | ||
* | ||
* @module clients/Extension/baseconstructor | ||
* @requires module:clients/Extension/extension | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const Extension = require('extension.class.js'); | ||
|
||
/** | ||
* Extension permettant de construire la base lunaire | ||
* | ||
* @class BaseConstructor | ||
* @memberof module:clients/Extension/baseconstructor | ||
* @extends clients/Extension/extension.Extension | ||
*/ | ||
class BaseConstructor extends Extension { | ||
constructor(){ | ||
// | ||
} | ||
} | ||
|
||
module.exports = BaseConstructor; |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Module du canon à balles | ||
* | ||
* @module clients/Extension/canon | ||
* @requires module:clients/Extension/extension | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const Extension = require('extension.class.js'); | ||
|
||
/** | ||
* Classe définissant le canon | ||
* | ||
* @class Canon | ||
* @memberof module:clients/Extension/canon | ||
* @extends {clients/Extension/extension.Extension} | ||
*/ | ||
class Canon extends Extension { | ||
constructor(){ | ||
// | ||
} | ||
} | ||
|
||
module.exports = Canon; |
Oops, something went wrong.