Generated Configurations

Functionality is from this pr

There are 3 UI elements which will save config.

save service config 
will save the current running service in its current state to a directory under data/config/{name}_config
You can change the name to anything you want.  I'd recommend not calling it the same name as your service, as that can lead to namespace pollution.

Runtime save config - will save all services in a flatten heirarchy

InMoov2 save config in equivalent to the save service config - but you can see what config exists and have options to start and release.

All config saved in any context is always saved under data/config A config directory is a python module.
You can start a module, by highlighting it and pressing the start button.

Requirements for this system

  • must allow easy, simple and fully self contained (e.g. everything needed in a directory) to allow simple managing and sharing of different configurations
  • all saving of config, starting or releasing needs to be using the same system regardless of the details of the config file structure
  • easy activation and managing through the UI
  • easy activation and managing through python
  • no "special tooling" for InMoov2

 


 

 

This is currently what I have which is generating initialization/configuration python files for InMoov2.
They are saved to a directory specified by the user.
They are grouped by peers, so all servo configuration for the head is in the i01_head.py file.

The export was done after the (start all servos) was pushed in the web ui.
All running peers of InMoov were exported, all non-running peers were not.

One of the pros of this is it is structured and handles the general case of exporting, there should be no difference in processing and output regardless of the service InMoov2 included.

Loading is simply done with an import in this case if you only wanted the head active the following would suffice.

from i01 import i01_head

And everything that was running that was running, which was part of the head is started with the appropriate configuration.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ray.Edgley's picture

Looks interesting

Could this be done with other robot designs, for example a Spot robot dog.

Hypothetical (I'm sort of planning it :-)
If I had a Raspberry Pi
with a PCA9685 using the Adafruit16Cservodriver service connected to the Raspi service
and 12 servos then connected to the PCA9685 using the servo service
as well as a MPU6050 service connected to the Raspi service

Could we save then reload the Raspi config to gett all the attached services to load as well?

This could make configuring a robot dog easier :-)

 

GroG's picture

Yes,  that's the plan

Yes, 
that's the plan Ray.
The idea you made some sort of software launch with multiple services, and lots of different configuration.  The goal is to be able to "export" all that running state (whatever it is) into a set of files which you can, if you wish, tweak, replace, re-configure, copy, adjust, clone, morph etc.

It would support quick iterative changes and development with Python.

GroG's picture

Heh Work-E has buck teeth

Heh Work-E has buck teeth

hairygael's picture

Hello Grog, I hadn't seen

Hello Grog,

I hadn't seen your post, and just discovered it now.

Thanks for the improvment on the export function, it will be super handy!

How will the export make the distinction on the head if some servos are connected to the left controller and some other servos to the right controller?

For exemple i01.head.rollNeck needs to be on port 12 of the right controller while i01.head.neck is connected to port 12 of the left controller.

Will the export be able also to set in the head.py if some servos are attached or not to the controller?

GroG's picture

The controllers would be 1st

The controllers would be 1st level  peers to InMoov2 - 
and you could have a configuration "set" which is a directory of configuration which includes the "default" controllers you want - e.g. the neuroboard 2 or 3 arduinos and have it all connected the way you want...
this means there would be a 
i01_left & i01_right ... I guess i01_controller3 or whatever you want.

The nice part is they will be externally defined, and replaceable with raspi controller.
If someone wanted to replace them it would just take changes on the inside of those files, a user could even come up with their own files .. but a "configuration" set would be a directory of those details.

hairygael's picture

That all sounds perfect!  

That all sounds perfect!

 

GroG's picture

(No subject)

GroG's picture

(No subject)

GroG's picture

Example of an Arduino Mega config with two servos

Arduino Mega - with pan and tilt servos

pan and tilt servos

hairygael's picture

Hello Grog, How do you

Hello Grog,

How do you generate the yaml config?  Or does it need to be manually written just like the ini files?

Can it be specificaly designed to replace the ini files or is it hard coded generating?

GroG's picture

Its currently being generated

Its currently being generated from Configuration objects - 

https://github.com/MyRobotLab/myrobotlab/tree/grog-config-yaml/src/main/...

You can construct them yourself, or the service config can be saved/generated as well.

It doesn't need to be hand created, it can replace the ini files ...

Its our decision to potentially add the parts we want.

But there is still some work:
 

  • How should the files be organized? Should a single file can have many services ? Should a single directory have many files ?
  • How will the files be loaded ?  Should we offer service.load(someFile) - (this is what happens at the moment)
  • How should the order of configuration be loaded - how is that organized in a directory, or in the file itself ?
  • How should the attach phase work ?