RelativeAngles
Measures relative Euler/Cardan angles between two frames.
Computes the three rotation angles to rotate frame_a into frame_b for the given axis sequence (default: [1,2,3] = XYZ). This is a sensor: no forces or torques are exerted.
Usage
MultibodyComponents.RelativeAngles()
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
sequence | – | [1, 2, 3] |
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)
frame_b- Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or severalFrame
connectors that can be connected together (Frame3D)
angle_1- This connector represents a real signal as an output from a component (RealOutput)angle_2- This connector represents a real signal as an output from a component (RealOutput)angle_3- This connector represents a real signal as an output from a component (RealOutput)
Variables
| Name | Description | Units |
|---|---|---|
R_rel | – | |
angles | rad |
Behavior
Dict{MIME{Symbol("text/plain")}, String} with 1 entry: MIME type text/plain => "Error displaying result"
Source
"""
Measures relative Euler/Cardan angles between two frames.
Computes the three rotation angles to rotate `frame_a` into `frame_b`
for the given axis `sequence` (default: [1,2,3] = XYZ).
This is a sensor: no forces or torques are exerted.
"""
component RelativeAngles
frame_a = Frame3D() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
},
"tags": []
}
}
frame_b = Frame3D() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
},
"tags": []
}
}
angle_1 = RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 130, "y1": 970, "x2": 230, "y2": 1070, "rot": 90}
},
"tags": []
}
}
angle_2 = RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 450, "y1": 960, "x2": 550, "y2": 1060, "rot": 90}
},
"tags": []
}
}
angle_3 = RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 770, "y1": 960, "x2": 870, "y2": 1060, "rot": 90}
},
"tags": []
}
}
structural parameter sequence::Integer[3] = [1, 2, 3]
variable R_rel::Real[3, 3]
variable angles::Angle[3]
relations
# Sensor exerts no forces or torques
frame_a.f = [0, 0, 0]
frame_a.tau = [0, 0, 0]
frame_b.f = [0, 0, 0]
frame_b.tau = [0, 0, 0]
# Relative rotation: from frame_a to frame_b
R_rel = frame_b.R * transpose(frame_a.R)
# Extract angles
angles = axes_rotationangles(R_rel, sequence)
[angle_1, angle_2, angle_3] = angles
metadata {
"Dyad": {
"icons": {"default": "dyad://MultibodyComponents/TwoFrameSensor.svg"},
"labels": [
{
"label": "$(instance)",
"x": 500,
"y": 150,
"rot": 0,
"attrs": {"font-size": "140"}
},
{"label": "rel ang", "x": 500, "y": 680, "rot": 0}
]
}
}
endFlattened Source
"""
Measures relative Euler/Cardan angles between two frames.
Computes the three rotation angles to rotate `frame_a` into `frame_b`
for the given axis `sequence` (default: [1,2,3] = XYZ).
This is a sensor: no forces or torques are exerted.
"""
component RelativeAngles
frame_a = Frame3D() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
},
"tags": []
}
}
frame_b = Frame3D() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
},
"tags": []
}
}
angle_1 = RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 130, "y1": 970, "x2": 230, "y2": 1070, "rot": 90}
},
"tags": []
}
}
angle_2 = RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 450, "y1": 960, "x2": 550, "y2": 1060, "rot": 90}
},
"tags": []
}
}
angle_3 = RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 770, "y1": 960, "x2": 870, "y2": 1060, "rot": 90}
},
"tags": []
}
}
structural parameter sequence::Integer[3] = [1, 2, 3]
variable R_rel::Real[3, 3]
variable angles::Angle[3]
relations
# Sensor exerts no forces or torques
frame_a.f = [0, 0, 0]
frame_a.tau = [0, 0, 0]
frame_b.f = [0, 0, 0]
frame_b.tau = [0, 0, 0]
# Relative rotation: from frame_a to frame_b
R_rel = frame_b.R * transpose(frame_a.R)
# Extract angles
angles = axes_rotationangles(R_rel, sequence)
[angle_1, angle_2, angle_3] = angles
metadata {
"Dyad": {
"icons": {"default": "dyad://MultibodyComponents/TwoFrameSensor.svg"},
"labels": [
{
"label": "$(instance)",
"x": 500,
"y": 150,
"rot": 0,
"attrs": {"font-size": "140"}
},
{"label": "rel ang", "x": 500, "y": 680, "rot": 0}
]
}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses