Skip to content

Instantly share code, notes, and snippets.

View zenfiric's full-sized avatar

Milan Jelisavcic zenfiric

View GitHub Profile
@zenfiric
zenfiric / differential_oscillator.R
Last active September 10, 2019 10:37
The basic differential oscillator used for robots' CPGs in the Revolve project
library(deSolve)
differential_oscilator <- function(t, y, parms) {
with(as.list(c(y, params)), expr = {
dx <- w_yx * y + bias_x
dy <- w_xy * x + bias_y
list(c(dx, dy))
})
}
times <- seq(from = 0, to = 20, by = 0.01)
@trollius.coroutine
def generate_population(self, n):
"""
Generates population of `n` valid robots robots.
:param n: Number of robots
:return: Future with a list of valid robot trees and corresponding
bounding boxes.
"""
logger.debug("Generating population of size %d..." % n)
restore_directory=restore
output_directory=milan-output3
robot_id_base=55
num_repetitions=1
birth_limit=40
population_limit=20
population_size=20
@zenfiric
zenfiric / generate_population.py
Created August 21, 2017 11:29
Load saved robots
@trollius.coroutine
def generate_population(self, n):
"""
Generates population of `n` valid robots robots.
:param n: Number of robots
:return: Future with a list of valid robot trees and corresponding
bounding boxes.
"""
yaml_robots = ['75', '76', '77', '78', '79',
from revolve.angle.robogen.spec import get_body_spec
from tol.config.config import parser
from revolve.generate import FixedOrientationBodyGenerator
from revolve.spec import BodyImplementation, PartSpec, ParamSpec
from revolve.angle.robogen.body_parts import *
channel_func = lambda channel: ParamSpec(channel, min_value=0, max_value=1, default=0.5, epsilon=0)
color_params = [channel_func("red"), channel_func("green"), channel_func("blue")]