Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the use of kilombo #44

Open
Hi-Ryan opened this issue Mar 2, 2018 · 3 comments
Open

About the use of kilombo #44

Hi-Ryan opened this issue Mar 2, 2018 · 3 comments

Comments

@Hi-Ryan
Copy link

Hi-Ryan commented Mar 2, 2018

How to set the initial position of the robot in a fixed position?

@fjansson
Copy link
Contributor

fjansson commented Mar 2, 2018

You can supply a json file containing the initial state of the simulation, by adding -b <initial.json> on the command line.

When the simulation ends, it writes the final state to the file endstate.json. You can use this file to see how the state file is formatted. You can also use the simulator as a GUI for editing the initial state:

  1. press / to set the speed to 0
  2. move the bots around to your liking
  3. exit the simulator, copy endstate.json to some other name, e.g. initial.json
  4. start from this state using -b initial.json

@Hi-Ryan
Copy link
Author

Hi-Ryan commented Mar 3, 2018

Thanks for your help. But I don't know how to make the simulation platform run initial.json. I noticed that "formation" can be added to kilombo.json file to make the robot distributed according to a certain rule. But I only know the straight line. What else is the distribution of it?

@fjansson
Copy link
Contributor

fjansson commented Mar 3, 2018

The options are documented in doc/manual.md

formation: Current options are random, line, pile, circle, ellipse

The idea with the formation option was just to give a quick way to try some simple standard formations. If you want something specific, provide the initial state with a json file instead. For example, with the gradient demo which is included with the code:

cd examples/gradient
make                          # compile the example
./gradient                    # run the example once, move bots as you want
cp endstate.json initial.json # copy the end state
./gradient -b initial.json    # run again starting from the final state of the first run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants