Skip to content
LIBRARY
URDFBodySphere.md

URDFBodySphere

Rigid body with sphere visualization, for URDF import.

Combines a Body with a SphereShape that honors the URDF <visual> origin translation (rotation is irrelevant for spheres).

This component extends from Renderable

Usage

MultibodyComponents.URDFBodySphere(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], radius=0.1)

Parameters:

NameDescriptionUnitsDefault value
rendertrue
colorworld_defau...ody_color()
specular_coefficient1.5
mmasskg1
r_cmVector from frame_a to center of mass, resolved in frame_am[0.0, 0, 0]
I_11kg.m20.001
I_22kg.m20.001
I_33kg.m20.001
I_21kg.m20
I_31kg.m20
I_32kg.m20
r_visualSphere center, resolved in frame_am[0, 0, 0]
radiusRadius of spherem0.1

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)

Behavior

Source

dyad
"""
Rigid body with sphere visualization, for URDF import.

Combines a `Body` with a `SphereShape` that honors the URDF `<visual>` origin
translation (rotation is irrelevant for spheres).
"""
component URDFBodySphere
  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)
  sphere_shape = SphereShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), r_shape = r_visual, length = 2 * radius, width = 2 * radius, height = 2 * radius)
  "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
  "Sphere center, resolved in frame_a"
  parameter r_visual::Length[3] = [0, 0, 0]
  "Radius of sphere"
  parameter radius::Length = 0.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
Flattened Source
dyad
"""
Rigid body with sphere visualization, for URDF import.

Combines a `Body` with a `SphereShape` that honors the URDF `<visual>` origin
translation (rotation is irrelevant for spheres).
"""
component URDFBodySphere
  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)
  sphere_shape = SphereShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), r_shape = r_visual, length = 2 * radius, width = 2 * radius, height = 2 * radius)
  "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
  "Sphere center, resolved in frame_a"
  parameter r_visual::Length[3] = [0, 0, 0]
  "Radius of sphere"
  parameter radius::Length = 0.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

No test cases defined.

  • Examples

  • Experiments

  • Analyses