---
url: /dyad/dev/stdlib/MultibodyComponents/components/URDFBodyBox.md
description: Dyad URDFBodyBox docs.  Rigid body with box visualization, for URDF import.
---

# `URDFBodyBox` {#URDFBodyBox}

Rigid body with box visualization, for URDF import.

Combines a `Body` with a `BoxShape` that honors the URDF `<visual>` origin.

This component extends from [`Renderable`](../types/Renderable.md)

## Usage {#Usage}

`MultibodyComponents.URDFBodyBox(render=true, color=world_default_body_color(), specular_coefficient=1.5, m=1, r_cm=[0.0, 0, 0], I_11=0.001, I_22=0.001, I_33=0.001, I_21=0, I_31=0, I_32=0, r_visual=[0, 0, 0], length_direction=[1, 0, 0], width_direction=[0, 1, 0], length=1, width=1, height=1)`

## Parameters: {#Parameters:}

|                   Name |                                                          Description | Units |             Default value |
| ----------------------:| --------------------------------------------------------------------:| -----:| -------------------------:|
|               `render` |                                                                      |     – |                      true |
|                `color` |                                                                      |     – | world_defau...ody_color() |
| `specular_coefficient` |                                                                      |     – |                       1.5 |
|                    `m` |                                                                 mass |    kg |                         1 |
|                 `r_cm` |           Vector from frame_a to center of mass, resolved in frame_a |     m |               \[0.0, 0, 0] |
|                 `I_11` |                                                                      | kg.m2 |                     0.001 |
|                 `I_22` |                                                                      | kg.m2 |                     0.001 |
|                 `I_33` |                                                                      | kg.m2 |                     0.001 |
|                 `I_21` |                                                                      | kg.m2 |                         0 |
|                 `I_31` |                                                                      | kg.m2 |                         0 |
|                 `I_32` |                                                                      | kg.m2 |                         0 |
|             `r_visual` |                            Center of box visual, resolved in frame_a |     m |                 \[0, 0, 0] |
|     `length_direction` | Box length direction in frame_a (local X rotated by URDF visual rpy) |     – |                 \[1, 0, 0] |
|      `width_direction` |  Box width direction in frame_a (local Y rotated by URDF visual rpy) |     – |                 \[0, 1, 0] |
|               `length` |                                        Length of box (along local X) |     m |                         1 |
|                `width` |                                         Width of box (along local Y) |     m |                         1 |
|               `height` |                                        Height of box (along local Z) |     m |                         1 |

## Connectors {#Connectors}

* `frame_a` - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`

connectors that can be connected together ([`Frame3D`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
Rigid body with box visualization, for URDF import.

Combines a `Body` with a `BoxShape` that honors the URDF `<visual>` origin.
"""
component URDFBodyBox
  extends Renderable(color = world_default_body_color())
  frame_a = Frame3D() {}
  body = Body(final m = m, final r_cm = r_cm, final I_11 = I_11, final I_22 = I_22, final I_33 = I_33, final I_21 = I_21, final I_31 = I_31, final I_32 = I_32, render = false)
  box_shape = BoxShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), r_shape = r_visual - 0.5 * length * length_direction, length_direction = length_direction, width_direction = width_direction, length = length, width = width, height = height)
  "mass"
  parameter m::Mass = 1
  "Vector from frame_a to center of mass, resolved in frame_a"
  parameter r_cm::Length[3] = [0.0, 0, 0]
  parameter I_11::Inertia = 0.001
  parameter I_22::Inertia = 0.001
  parameter I_33::Inertia = 0.001
  parameter I_21::Inertia = 0
  parameter I_31::Inertia = 0
  parameter I_32::Inertia = 0
  "Center of box visual, resolved in frame_a"
  parameter r_visual::Length[3] = [0, 0, 0]
  "Box length direction in frame_a (local X rotated by URDF visual rpy)"
  parameter length_direction::Real[3] = [1, 0, 0]
  "Box width direction in frame_a (local Y rotated by URDF visual rpy)"
  parameter width_direction::Real[3] = [0, 1, 0]
  "Length of box (along local X)"
  parameter length::Length = 1
  "Width of box (along local Y)"
  parameter width::Length = 1
  "Height of box (along local Z)"
  parameter height::Length = 1
relations
  connect(frame_a, body.frame_a)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/Body.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

```dyad
"""
Rigid body with box visualization, for URDF import.

Combines a `Body` with a `BoxShape` that honors the URDF `<visual>` origin.
"""
component URDFBodyBox
  parameter render::Boolean = true
  parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
  parameter specular_coefficient::Real = 1.5
  frame_a = Frame3D() {}
  body = Body(final m = m, final r_cm = r_cm, final I_11 = I_11, final I_22 = I_22, final I_33 = I_33, final I_21 = I_21, final I_31 = I_31, final I_32 = I_32, render = false)
  box_shape = BoxShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), r_shape = r_visual - 0.5 * length * length_direction, length_direction = length_direction, width_direction = width_direction, length = length, width = width, height = height)
  "mass"
  parameter m::Mass = 1
  "Vector from frame_a to center of mass, resolved in frame_a"
  parameter r_cm::Length[3] = [0.0, 0, 0]
  parameter I_11::Inertia = 0.001
  parameter I_22::Inertia = 0.001
  parameter I_33::Inertia = 0.001
  parameter I_21::Inertia = 0
  parameter I_31::Inertia = 0
  parameter I_32::Inertia = 0
  "Center of box visual, resolved in frame_a"
  parameter r_visual::Length[3] = [0, 0, 0]
  "Box length direction in frame_a (local X rotated by URDF visual rpy)"
  parameter length_direction::Real[3] = [1, 0, 0]
  "Box width direction in frame_a (local Y rotated by URDF visual rpy)"
  parameter width_direction::Real[3] = [0, 1, 0]
  "Length of box (along local X)"
  parameter length::Length = 1
  "Width of box (along local Y)"
  parameter width::Length = 1
  "Height of box (along local Z)"
  parameter height::Length = 1
relations
  connect(frame_a, body.frame_a)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/Body.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
