nbarikipoulos / poppy-robot-core Goto Github PK
View Code? Open in Web Editor NEWRemotely drive/query Poppy (Ergo Jr) robots in JavaScipt
License: MIT License
Remotely drive/query Poppy (Ergo Jr) robots in JavaScipt
License: MIT License
aka from 0.19.2 to 0.20.0
In the exec function, in addition to ellipsis parameters, add possibility to use array of scripts.
To many lack/fail cases.
If the 'present_position' register value is not equal to the 'goal_position' one, switching the 'compliant' state of a motor to 'false' will imply movement to the goal position.
Then, add a new boolean argument named 'safe' to the setCompliant function of the ExtMotorRequest in order to reset or not the goal position to the present position when switching the compliant state to 'false'.
Set it default value to 'true' i.e. it will reset the goal position value to the present position one when compliant state is set to 'false'
To resume, add the following argument: @param {boolean=} [safe=true]
and then, it could be impossible to use the default 'poppy.local' hostname.
Store motor id in the robot descriptor when discovering the robot structure
Poppy motors and set of motors (aka alias) are nowadays provided through:
Furthermore The default configuration is set to internal Poppy Ergo Jr descriptor.
In order to avoid extra settings for users to extend to any motor configuration driven by pypot (or other robot of the Poppy family), Change it to:
In the computation of the estimated duration:
Use 1023 as speed value (cf. XL 320 manual )
Replace the compliant(boolean) function in Script with two functions witout arguments:
In ExtMotorRequest the optional wait value is set to:
Set it to false for both.
Post request are not correctly performed and could implies dysfunctionnement of the robot (corrupting the registers of the motors.)
The response of the request /motor//list.json has changed: it now returns { : ["m1", "m2", etc...] } instead of { "alias": ["m1", "m2", etc...] }
In PoppyRequestHandler object:
Generic issue that gathers code improvement or update.
Do not "hide" anymore the asynchronous js/node "behavior."
This is mainly motivated by removing the limitation due to the sync-like suggered coding nowadays used.
Indeed, all async operations execution are "deported" in the last stage i.e. the script execution ( which is asynchronous). All others, such as Poppy instantiation, script definition, etc... could be considered as pre-execution stages only dedicated to define and describe operations for script execution.
That:
In particular, #2 which need to query robot as initial step, could not be fixed.
Do not instantiate the robot descriptor from inner methods of Poppy robot but provide it from constructor parameters.
Then, adapt the poppy object factory to handle descriptor instantiation.
aka the 0.21.0 one.
It seems to be connected with the use of (many?) custom instance in Axios.
As:
Replace custom instance with direct call of axios with specific config settings for each kind of request.
Way to provide robot descriptor through an input file is useless and it should be only done via live disovering of the target robot.
Then notion of descriptor locator in config should be removed as well as corresponding code.
In settings, add a function in order to:
In connection object:
In order to avoid "overload" of the robot server, chain requests of "complex" commands (aka that are based on many requests) such as discovering the structure of the robot/ querying many registers/motors.
Aim is to avoid to "overload" the robot REST api with to many requests in the same time, especially when many clients are connected on (cli or ui as example).
Sometimes (often enough) next to some (unfortunately unidentified) actions, register value seems to be frozen or http server does not respond well.
Next to perfoming a reset request, everything seems to back to normal.
Then add it.
When motors are already stiff, changing the target speed with 'goal_speed' could imply "invonluntary" movement depending of the goal/present position values.
Too boring/complicate to use/set in script compared to the 'moving_speed' register
On getRegister function of PoppyRequestHandler, in order to avoid globally throwing an error when a request failed for a register:
req.getRegister('m1', 'present_position', 'compliant')
will return
{ present_position: 90.0, compliant: undefined }
instead of throwing error is request on register 'compliant' failed.
Add new condition about expected duration of the mouvement.
Use the "files" property in package.json on order to ensure to not pack unwanted/extra files.
Add the model of the motor.
Mention these points in documentation:
aka to poppy software 4.0.0
In object factories, simplify arg from
createXXX({ connect })
to
js createXXX(connect)
aka change the poppy configuration object structure from
{ connect: { hostname: .., port: ..., ... } }
to
{ hostname: .., port: ..., ... }
As it could be a hostname or an ip, it seems to be clearer.
When an error occurs, the perform function of the PoppyRequestHandler return an error object instead of throwing it.
Uniformize it with other get request: '/list.json' sufix is missing.
Next to #12, it is not mandatory to use the snap rest api to set led values (it was a side effect).
Then remove any use of the rest api exposed by snap.
Then simplify the connection settings object: rename httpPort to port.
Add a factory to create new PoppyRequestHandler that automatically:
Robot descriptor (aka motors list and settings) are nowadays:
Add a live discovering feature.
Set it to 500ms instead of 1s
Use the 'goal_position' register instead of 'present_postion' to get the target position value.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.