Skip to main content

Revolve2: Everything for defining modular robots.

Project description

Revolve2

Revolve2 is a collection of Python packages used for researching evolutionary algorithms and modular robotics. Its primary features are a modular robot framework, an abstraction layer around physics simulators, and evolutionary algorithms.

Documentation: ci-group.github.io/revolve2

Installation: ci-group.github.io/revolve2/installation

Get help: github.com/ci-group/revolve2/discussions/categories/ask-for-help

DOI License: LGPL v3 CI

Sample

Here we create and simulate a modular robot, and then calculate how far it moved over the xy plane. This is a shortened version of examples/evaluate_single_robot.

# (...) Omitted preamble

# Create a modular robot.
body = modular_robots_v1.gecko_v1()
brain = BrainCpgNetworkNeighborRandom(body=body, rng=rng)
robot = ModularRobot(body, brain)

# Create a scene.
scene = ModularRobotScene(terrain=terrains.flat())
scene.add_robot(robot)

# Create a simulator.
simulator = LocalSimulator(headless=False)

# Simulate the scene and obtain states sampled during the simulation.
scene_states = simulate_scenes(
    simulator=simulator,
    batch_parameters=make_standard_batch_parameters(),
    scenes=scene,
)

# Get the state at the beginning and end of the simulation.
scene_state_begin = scene_states[0]
scene_state_end = scene_states[-1]

# Retrieve the states of the modular robot.
robot_state_begin = scene_state_begin.get_modular_robot_simulation_state(robot)
robot_state_end = scene_state_end.get_modular_robot_simulation_state(robot)

# Calculate the xy displacement of the robot.
xy_displacement = fitness_functions.xy_displacement(
    robot_state_begin, robot_state_end
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revolve2_modular_robot-1.2.4-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file revolve2_modular_robot-1.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for revolve2_modular_robot-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc560de0fc26add596c2149c722c27ee87b548fcdeb0eb13a57a4d8a42dcad0
MD5 fa2b026b0ef97979192bdb43a0cb6acc
BLAKE2b-256 6daa1c3877ccac43f17d1c12c90dc889ca3c8577d289b43d3ca914e9dd9d29e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for revolve2_modular_robot-1.2.4-py3-none-any.whl:

Publisher: main.yml on ci-group/revolve2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page