Skip to content
Snippets Groups Projects
Select Git revision
  • dev_mathis
  • develop
  • master default protected
  • colored_track
  • show-text
  • dev_gian
  • efb-rendering
  • develop_marc
  • docstrings
  • pdocs
  • 0.4.0 protected
  • 0.3.6.1 protected
  • 0.3.6 protected
  • 0.3.5 protected
  • 0.3.4 protected
  • 0.3.3 protected
  • 0.3.2.3 protected
  • 0.3.2.2 protected
  • 0.3.2.1 protected
  • 0.3.2 protected
  • 0.3.1 protected
  • 0.3.0 protected
  • 0.2.16 protected
  • 0.2.15 protected
  • 0.2.14 protected
  • 0.2.13 protected
  • 0.2.12 protected
  • 0.2.11 protected
  • 0.2.10 protected
  • 0.2.9 protected
30 results

io

  • Clone with SSH
  • Clone with HTTPS
  • Andi Gerken's avatar
    Andi Gerken authored
    Added "all" mode to evaluation
    5bd4ab6d
    History

    pipeline status

    Robofish IO

    This repository implements an easy to use interface, to create, save, load, and work specification-compliant hdf5 files, containing 2D swarm data. This repository should be used by the different swarm projects to generate comparable standardized files.

    Documentation

    Installation

    Add our Artifacts repository to your pip config and install the packagage.

    python3 -m pip config set global.extra-index-url https://git.imp.fu-berlin.de/api/v4/projects/6392/packages/pypi/simple
    python3 -m pip install robofish-io robofish-trackviewer

    Better variant:

    Usage

    We show a simple example below. More examples can be found in examples/

    import robofish.io
    import numpy as np
    
    
    # Create a new robofish io file
    f = robofish.io.File(world_size_cm=[100, 100], frequency_hz=25.0)
    f.attrs["experiment_setup"] = "This is a simple example with made up data."
    
    # Create a new robot entity. Positions and orientations are passed
    # separately in this example. Since the orientations have two columns,
    # unit vectors are assumed (orientation_x, orientation_y)
    f.create_entity(
        category="robot",
        name="robot",
        positions=np.zeros((100, 2)),
        orientations=np.ones((100, 2)) * [0, 1],
    )
    
    # Create a new fish entity.
    # In this case, we pass positions and orientations together (x, y, rad).
    # Since it is a 3 column array, orientations in radiants are assumed.
    poses = np.zeros((100, 3))
    poses[:, 0] = np.arange(-50, 50)
    poses[:, 1] = np.arange(-50, 50)
    poses[:, 2] = np.arange(0, 2 * np.pi, step=2 * np.pi / 100)
    fish = f.create_entity("fish", poses=poses)
    fish.attrs["species"] = "My rotating spaghetti fish"
    fish.attrs["fish_standard_length_cm"] = 10
    
    # Show and save the file
    print(f)
    print("Poses Shape: ", f.entity_poses.shape)
    
    f.save_as(path)

    Evaluation

    Evaluate your tracks with robofish-io-evaluate $mode $file(s) Current modes are:

    • speed
    • turn
    • tank_positions
    • trajectories
    • follow_iid

    LICENSE

    This work is licensed under LGPL 3.0 (or any later version). Individual files contain the following tag instead of the full license text:

    SPDX-License-Identifier: LGPL-3.0-or-later

    This enables machine processing of license information based on the SPDX License Identifiers available here: https://spdx.org/licenses/