BB
View SourceThe DSL extension for describing robot properties and topologies.
topology
Robot topology
Nested DSLs
- link
- inertial
- origin
- inertia
- visual
- box
- cylinder
- sphere
- mesh
- material
- color
- texture
- origin
- collision
- origin
- box
- cylinder
- sphere
- mesh
- sensor
- param
- inertial
- joint
- origin
- axis
- dynamics
- limit
- sensor
- param
- actuator
- param
topology.link
link nameA kinematic link (ie solid body).
Nested DSLs
- inertial
- origin
- inertia
- visual
- box
- cylinder
- sphere
- mesh
- material
- color
- texture
- origin
- collision
- origin
- box
- cylinder
- sphere
- mesh
- sensor
- param
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | The name of the link |
topology.link.inertial
A link's mass, position of it's center of mass and it's central inertia properties
Nested DSLs
Options
| Name | Type | Default | Docs |
|---|---|---|---|
mass | any | The mass of the link |
topology.link.inertial.origin
Specifies where the link's center of mass is located, relative to the link's reference frame
Options
| Name | Type | Default | Docs |
|---|---|---|---|
roll | any | Cldr.Unit.new!(:degree, 0) | rotation around the x axis |
pitch | any | Cldr.Unit.new!(:degree, 0) | rotation around the y axis |
yaw | any | Cldr.Unit.new!(:degree, 0) | rotation around the z axis |
x | any | Cldr.Unit.new!(:meter, 0) | translation along the x axis |
y | any | Cldr.Unit.new!(:meter, 0) | translation along the y axis |
z | any | Cldr.Unit.new!(:meter, 0) | translation along the z axis |
Introspection
Target: BB.Dsl.Origin
topology.link.inertial.inertia
How the link resists rotational motion.
Options
| Name | Type | Default | Docs |
|---|---|---|---|
ixx | any | Resistance to rotation around the x-axis | |
iyy | any | Resistance to rotation around the y-axis | |
izz | any | Resistance to rotation around the z-axis | |
ixy | any | Coupling between the x and y axes | |
ixz | any | Coupling between the x and z axes | |
iyz | any | Coupling between the y and z axes |
Introspection
Target: BB.Dsl.Inertia
Introspection
Target: BB.Dsl.Inertial
topology.link.visual
Visual attributes for a link.
Nested DSLs
topology.link.visual.box
Box geometry
Options
| Name | Type | Default | Docs |
|---|---|---|---|
x | any | The length of the X axis side | |
y | any | The length of the Y axis side | |
z | any | The length of the Z axis side |
Introspection
Target: BB.Dsl.Box
topology.link.visual.cylinder
A cylindrical geometry
The origin of the cylinder is the center.
Options
| Name | Type | Default | Docs |
|---|---|---|---|
radius | any | The distance from the center to the circumference | |
height | any | The height of the cylinder |
Introspection
Target: BB.Dsl.Cylinder
topology.link.visual.sphere
A spherical geometry
The origin of the sphere is its center.
Options
| Name | Type | Default | Docs |
|---|---|---|---|
radius | any | The distance from the center of the sphere to your edge |
Introspection
Target: BB.Dsl.Sphere
topology.link.visual.mesh
A mesh object specified by a filename
Options
| Name | Type | Default | Docs |
|---|---|---|---|
filename | String.t | The path to the 3D model | |
scale | number | 1 | A scale factor for the mest |
Introspection
Target: BB.Dsl.Mesh
topology.link.visual.material
The material of the visual element
Nested DSLs
Options
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | The name of the material |
topology.link.visual.material.color
The color of the meterial
Options
| Name | Type | Default | Docs |
|---|---|---|---|
red | any | The red element of the color | |
green | any | The green element of the color | |
blue | any | The blue element of the color | |
alpha | any | The alpha element of the color |
Introspection
Target: BB.Dsl.Color
topology.link.visual.material.texture
A texture to apply to the material
Options
| Name | Type | Default | Docs |
|---|---|---|---|
filename | String.t | The image file to use |
Introspection
Target: BB.Dsl.Texture
Introspection
Target: BB.Dsl.Material
topology.link.visual.origin
The refrence frame of the visual element with respect to the reference frame of the link
Options
| Name | Type | Default | Docs |
|---|---|---|---|
roll | any | Cldr.Unit.new!(:degree, 0) | rotation around the x axis |
pitch | any | Cldr.Unit.new!(:degree, 0) | rotation around the y axis |
yaw | any | Cldr.Unit.new!(:degree, 0) | rotation around the z axis |
x | any | Cldr.Unit.new!(:meter, 0) | translation along the x axis |
y | any | Cldr.Unit.new!(:meter, 0) | translation along the y axis |
z | any | Cldr.Unit.new!(:meter, 0) | translation along the z axis |
Introspection
Target: BB.Dsl.Origin
Introspection
Target: BB.Dsl.Visual
topology.link.collision
The collision properties of a link.
Nested DSLs
Options
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | An optional name of the link geometry |
topology.link.collision.origin
The refrence frame of the collision element, relative to the reference frame of the link
Options
| Name | Type | Default | Docs |
|---|---|---|---|
roll | any | Cldr.Unit.new!(:degree, 0) | rotation around the x axis |
pitch | any | Cldr.Unit.new!(:degree, 0) | rotation around the y axis |
yaw | any | Cldr.Unit.new!(:degree, 0) | rotation around the z axis |
x | any | Cldr.Unit.new!(:meter, 0) | translation along the x axis |
y | any | Cldr.Unit.new!(:meter, 0) | translation along the y axis |
z | any | Cldr.Unit.new!(:meter, 0) | translation along the z axis |
Introspection
Target: BB.Dsl.Origin
topology.link.collision.box
Box geometry
Options
| Name | Type | Default | Docs |
|---|---|---|---|
x | any | The length of the X axis side | |
y | any | The length of the Y axis side | |
z | any | The length of the Z axis side |
Introspection
Target: BB.Dsl.Box
topology.link.collision.cylinder
A cylindrical geometry
The origin of the cylinder is the center.
Options
| Name | Type | Default | Docs |
|---|---|---|---|
radius | any | The distance from the center to the circumference | |
height | any | The height of the cylinder |
Introspection
Target: BB.Dsl.Cylinder
topology.link.collision.sphere
A spherical geometry
The origin of the sphere is its center.
Options
| Name | Type | Default | Docs |
|---|---|---|---|
radius | any | The distance from the center of the sphere to your edge |
Introspection
Target: BB.Dsl.Sphere
topology.link.collision.mesh
A mesh object specified by a filename
Options
| Name | Type | Default | Docs |
|---|---|---|---|
filename | String.t | The path to the 3D model | |
scale | number | 1 | A scale factor for the mest |
Introspection
Target: BB.Dsl.Mesh
Introspection
Target: BB.Dsl.Collision
topology.link.sensor
sensor name, child_specA sensor attached to the robot, a link, or a joint.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the sensor | |
child_spec | module | {module, keyword} | The child specification for the sensor process. Either a module or {module, keyword_list} |
topology.link.sensor.param
param nameA runtime-adjustable parameter.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the parameter |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
type | any | The parameter value type (:float, :integer, :boolean, :string, :atom, or {:unit, unit_type}) | |
default | any | Default value for the parameter | |
min | number | Minimum value for numeric parameters | |
max | number | Maximum value for numeric parameters | |
doc | String.t | Documentation for the parameter |
Introspection
Target: BB.Dsl.Param
Introspection
Target: BB.Dsl.Sensor
Introspection
Target: BB.Dsl.Link
topology.joint
joint nameA kinematic joint between a parent link and a child link.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the joint |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
type | :revolute | :continuous | :prismatic | :fixed | :floating | :planar | Specifies the type of joint |
topology.joint.origin
This is the transform from the parent link to the child link. The joint is located at the origin of the child link, as shown in the figure above
Options
| Name | Type | Default | Docs |
|---|---|---|---|
roll | any | Cldr.Unit.new!(:degree, 0) | rotation around the x axis |
pitch | any | Cldr.Unit.new!(:degree, 0) | rotation around the y axis |
yaw | any | Cldr.Unit.new!(:degree, 0) | rotation around the z axis |
x | any | Cldr.Unit.new!(:meter, 0) | translation along the x axis |
y | any | Cldr.Unit.new!(:meter, 0) | translation along the y axis |
z | any | Cldr.Unit.new!(:meter, 0) | translation along the z axis |
Introspection
Target: BB.Dsl.Origin
topology.joint.axis
The joint axis specified in the joint frame. This is the axis of rotation for revolute joints, the axis of translation for prismatic joints, and the surface normal for planar joints. The axis is specified in the joint frame of reference. Fixed and floating joints do not use the axis field
Options
| Name | Type | Default | Docs |
|---|---|---|---|
roll | any | Cldr.Unit.new!(:degree, 0) | rotation around the X axis |
pitch | any | Cldr.Unit.new!(:degree, 0) | rotation around the Y axis |
yaw | any | Cldr.Unit.new!(:degree, 0) | rotation around the Z axis |
Introspection
Target: BB.Dsl.Axis
topology.joint.dynamics
An element specifying physical properties of the joint. These values are used to specify modeling properties of the joint, particularly useful for simulation.
Options
| Name | Type | Default | Docs |
|---|---|---|---|
damping | any | The physical damping value of the joint | |
friction | any | The physical static friction value of the joint |
Introspection
Target: BB.Dsl.Dynamics
topology.joint.limit
Limits applied to joint movement
Options
| Name | Type | Default | Docs |
|---|---|---|---|
effort | any | The maximum effort - both positive and negative - that can be commanded to the joint | |
velocity | any | Maximum velocity - both positive and negative - that can be commanded to the joint | |
lower | any | The lower joint limit | |
upper | any | The upper joint limit |
Introspection
Target: BB.Dsl.Limit
topology.joint.sensor
sensor name, child_specA sensor attached to the robot, a link, or a joint.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the sensor | |
child_spec | module | {module, keyword} | The child specification for the sensor process. Either a module or {module, keyword_list} |
topology.joint.sensor.param
param nameA runtime-adjustable parameter.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the parameter |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
type | any | The parameter value type (:float, :integer, :boolean, :string, :atom, or {:unit, unit_type}) | |
default | any | Default value for the parameter | |
min | number | Minimum value for numeric parameters | |
max | number | Maximum value for numeric parameters | |
doc | String.t | Documentation for the parameter |
Introspection
Target: BB.Dsl.Param
Introspection
Target: BB.Dsl.Sensor
topology.joint.actuator
actuator name, child_specAn actuator attached to a joint.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the actuator | |
child_spec | module | {module, keyword} | The child specification for the actuator process. Either a module or {module, keyword_list} |
topology.joint.actuator.param
param nameA runtime-adjustable parameter.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the parameter |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
type | any | The parameter value type (:float, :integer, :boolean, :string, :atom, or {:unit, unit_type}) | |
default | any | Default value for the parameter | |
min | number | Minimum value for numeric parameters | |
max | number | Maximum value for numeric parameters | |
doc | String.t | Documentation for the parameter |
Introspection
Target: BB.Dsl.Param
Introspection
Target: BB.Dsl.Actuator
Introspection
Target: BB.Dsl.Joint
settings
System-wide settings
Options
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | The name of the robot, defaults to the name of the defining module | |
registry_module | module | Registry | The registry module to use |
registry_options | keyword | Options passed to Registry.start_link/1. Defaults to [partitions: System.schedulers_online()] at runtime. | |
supervisor_module | module | Supervisor | The supervisor module to use |
parameter_store | module | {module, keyword} | Optional parameter persistence backend. Use a module or {Module, opts} tuple. |
sensors
Robot-level sensors
Nested DSLs
- sensor
- param
sensors.sensor
sensor name, child_specA sensor attached to the robot, a link, or a joint.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the sensor | |
child_spec | module | {module, keyword} | The child specification for the sensor process. Either a module or {module, keyword_list} |
sensors.sensor.param
param nameA runtime-adjustable parameter.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the parameter |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
type | any | The parameter value type (:float, :integer, :boolean, :string, :atom, or {:unit, unit_type}) | |
default | any | Default value for the parameter | |
min | number | Minimum value for numeric parameters | |
max | number | Maximum value for numeric parameters | |
doc | String.t | Documentation for the parameter |
Introspection
Target: BB.Dsl.Param
Introspection
Target: BB.Dsl.Sensor
controllers
Robot-level controllers
Nested DSLs
- controller
- param
controllers.controller
controller name, child_specA controller process at the robot level.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the controller | |
child_spec | module | {module, keyword} | The child specification for the controller process. Either a module or {module, keyword_list} |
controllers.controller.param
param nameA runtime-adjustable parameter.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the parameter |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
type | any | The parameter value type (:float, :integer, :boolean, :string, :atom, or {:unit, unit_type}) | |
default | any | Default value for the parameter | |
min | number | Minimum value for numeric parameters | |
max | number | Maximum value for numeric parameters | |
doc | String.t | Documentation for the parameter |
Introspection
Target: BB.Dsl.Param
Introspection
Target: BB.Dsl.Controller
commands
Robot commands with Goal → Feedback → Result semantics
Nested DSLs
- command
- argument
commands.command
command nameA command that can be executed on the robot.
Commands follow the Goal → Feedback → Result pattern and integrate with the robot's state machine to control when they can run.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the command |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
handler | module | The handler module implementing the BB.Command behaviour | |
timeout | pos_integer | :infinity | :infinity | Timeout for command execution in milliseconds |
allowed_states | list(atom) | [:idle] | Robot states in which this command can run. If :executing is included, the command can preempt running commands. |
commands.command.argument
argument name, typeAn argument for the command.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the argument | |
type | atom | module | The type of the argument (e.g., :float, :integer, BB.Pose) |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
required | boolean | false | Whether this argument is required |
default | any | Default value if not provided | |
doc | String.t | Documentation for the argument |
Introspection
Target: BB.Dsl.Command.Argument
Introspection
Target: BB.Dsl.Command
parameters
Runtime-adjustable parameters for the robot.
Parameters provide a way to configure robot behaviour at runtime without recompilation. They support validation, change notifications via PubSub, and optional persistence.
Example
parameters do group :motion do param :max_linear_speed, type: :float, default: 1.0, min: 0.0, max: 10.0, doc: "Max velocity in m/s" param :max_angular_speed, type: :float, default: 0.5 end
group :safety do param :collision_distance, type: :float, default: 0.3 end end
Nested DSLs
parameters.group
group nameA group of runtime-adjustable parameters.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the parameter group |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
doc | String.t | Documentation for the parameter group |
parameters.group.param
param nameA runtime-adjustable parameter.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the parameter |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
type | any | The parameter value type (:float, :integer, :boolean, :string, :atom, or {:unit, unit_type}) | |
default | any | Default value for the parameter | |
min | number | Minimum value for numeric parameters | |
max | number | Maximum value for numeric parameters | |
doc | String.t | Documentation for the parameter |
Introspection
Target: BB.Dsl.Param
Introspection
Target: BB.Dsl.ParamGroup
parameters.param
param nameA runtime-adjustable parameter.
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the parameter |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
type | any | The parameter value type (:float, :integer, :boolean, :string, :atom, or {:unit, unit_type}) | |
default | any | Default value for the parameter | |
min | number | Minimum value for numeric parameters | |
max | number | Maximum value for numeric parameters | |
doc | String.t | Documentation for the parameter |
Introspection
Target: BB.Dsl.Param
parameters.bridge
bridge name, child_specA parameter protocol bridge for remote access.
Bridges expose robot parameters to remote clients (GCS, web UI, etc.)
and receive parameter updates from them. They implement BB.Parameter.Protocol.
Example
parameters do bridge :mavlink, {BBMavLink.ParameterBridge, conn: "/dev/ttyACM0"} bridge :phoenix, {BBPhoenix.ParameterBridge, url: "ws://gcs.local/socket"} end
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the bridge | |
child_spec | module | {module, keyword} | The child specification for the bridge process. Either a module or {module, keyword_list} |
Introspection
Target: BB.Dsl.Bridge