cmdgen

package
v0.0.0-...-70b330c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyWorld is returned when an empty world name is passed when calling CommsBridge.
	ErrEmptyWorld = errors.New("empty world")
	// ErrInvalidRobot is returned when an invalid robot is passed when calling CommsBridge.
	ErrInvalidRobot = errors.New("invalid robot")
	// ErrEmptyRobotList is returned when an empty robot list is passed when calling MapAnalysis.
	ErrEmptyRobotList = errors.New("empty robot list")
)

Functions

func CommsBridge

func CommsBridge(config CommsBridgeConfig) ([]string, error)

CommsBridge generates the arguments needed to run in the comms bridge container.

func Gazebo

func Gazebo(params GazeboConfig) []string

Gazebo generates the needed arguments to initialize the gzserver.

func MapAnalysis

func MapAnalysis(config MapAnalysisConfig) ([]string, error)

MapAnalysis generates a set of arguments to configure the Mapping server container.

Types

type CommsBridgeConfig

type CommsBridgeConfig struct {
	// World represents a command to launch a certain world with the needed parameters.
	World string
	// RobotNumber is a number from 0 to the max number of robots - 1.
	// It usually is the index when looping over the list of robots for a certain simulation.
	RobotNumber int
	// Robot is the robot launched in the field computer linked to the comms bridge container.
	Robot simulations.Robot
	// ChildMarsupial is true if the robot given in this configuration is a marsupial child.
	ChildMarsupial bool
}

CommsBridgeConfig includes the information needed to generate the arguments for the comms bridge container.

type GazeboConfig

type GazeboConfig struct {
	// World is a gazebo world with parameters.
	// Example:
	// 	"tunnel_circuit_practice.ign;worldName:=tunnel_circuit_practice_01"
	World string

	// WorldMaxSimSeconds is the total amount of seconds that a simulation can run.
	WorldMaxSimSeconds time.Duration

	// Seed is used to randomly generate a world.
	// If no seed is provided, gazebo will generate its own seed.
	Seed *int

	// AuthorizationToken has the token used for the gazebo websocket server.
	AuthorizationToken *string

	// MaxWebsocketConnections determines the maximum amount of connections that can be established with
	// the websocket server.
	MaxWebsocketConnections int

	// Robots is a group of robots that will be used for this simulation.
	Robots []simulations.Robot

	// Marsupials is a group of parent-child pair robots. The robots used as parent and child should be in the
	// Robots slice as well.
	Marsupials []simulations.Marsupial

	// RosEnabled is used to enable ros when launching gazebo server.
	RosEnabled bool
}

GazeboConfig includes the information to create the launch command arguments needed to launch gazebo server.

type MapAnalysisConfig

type MapAnalysisConfig struct {
	// World is a gazebo world with parameters.
	// Example:
	// 	"tunnel_circuit_practice.ign;worldName:=tunnel_circuit_practice_01"
	World string

	// Robots includes the information about all simulation robots.
	Robots []simulations.Robot
}

MapAnalysisConfig has the fields needed to configure a Mapping server container.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL