LIBRARY
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:
| 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 | Sphere center, resolved in frame_a | m | [0, 0, 0] |
radius | Radius of sphere | m | 0.1 |
Connectors
frame_a- Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or severalFrame
connectors that can be connected together (Frame3D)
Behavior
julia
using MultibodyComponents #hide
using ModelingToolkit #hide
@variables render #hide
@variables color #hide
@variables specular_coefficient #hide
@variables m #hide
@variables r_cm #hide
@variables I_11 #hide
@variables I_22 #hide
@variables I_33 #hide
@variables I_21 #hide
@variables I_31 #hide
@variables I_32 #hide
@variables r_visual #hide
@variables radius #hide
@named sys = MultibodyComponents.URDFBodySphere(render=render, color=color, specular_coefficient=specular_coefficient, m=m, r_cm=r_cm, I_11=I_11, I_22=I_22, I_33=I_33, I_21=I_21, I_31=I_31, I_32=I_32, r_visual=r_visual, radius=radius) #hide
let eqs = full_equations(sys); Base.length(eqs) > 25 ? nothing : eqs end #hide<< @example-block not executed in draft mode >>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"}
}
]
}
}
endFlattened 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"}
}
]
}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses