visualdynamics.core.sensors¶
sensors
¶
Where each sensor a channel table names sits on a geometry, and which way it faces: the placement the 3-D view draws a sensor's body with.
One physical sensor is a node and a model. A triaxial accelerometer is its rows at one node with one model; a uniaxial accelerometer or a force transducer is one row. Only acceleration and force rows that name a model place a sensor: a row with no model says what is measured, not with what, and its DOF arrow already marks it. A model named but not in the catalog is drawn as a generic body of its kind.
The node is the center of the body. A triax's frame is its legs: the
Triax DOF column says which leg a row is (blank: the row's own direction
letter), and the row's direction in global coordinates
(Geometry.dof_direction, the rule behind the table's Unit X, Y and Z)
is that leg's positive direction. Two legs give the third. Legs that
are not perpendicular, or that make a left-handed frame, are an error in
the table; the sensor is then drawn as a generic body on the node's own
axes and a note names the node. A uniaxial sensor's or a force
transducer's sensing axis is its row's direction, through the node; its
turn about that axis is fixed by one rule, the connector toward the
node's local +X (+Y when the sensing axis is along X), since a table
does not say it.
Orientation comes from the table alone, never from the surface a sensor is mounted on. A wrong sign in the table shows in the drawing: a triax's lettered face, or a uniaxial's arrow, points the wrong way.
Classes:
| Name | Description |
|---|---|
Sensor |
One sensor placed on a geometry. |
Functions:
| Name | Description |
|---|---|
place |
The sensors a channel table places on a geometry, and notes on |
Classes¶
Sensor
dataclass
¶
Sensor(node: int, model: str, entry: SensorModel, center: ndarray, frame: ndarray, rows: tuple[int, ...], generic: bool, marked: bool = True)
One sensor placed on a geometry.
center is the node's coordinates as the geometry holds them.
frame's columns are the body's x, y and z in global coordinates, a
right-handed set of unit vectors. marked says the body carries its
marks, a triax's letters or a uniaxial's arrow: not when the frame is
the node's own axes because the table's legs could not be read, since
the marks would then say what the table does not.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
str
|
'triax', 'uniaxial' or 'force'. |
Functions:¶
place
¶
place(table: Any, geometry: Any) -> tuple[list[Sensor], list[str]]
The sensors a channel table places on a geometry, and notes on what could not be placed as the table says.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
ChannelTable
|
The channels: node, direction, channel type, make, model and Triax DOF are read. |
required |
geometry
|
Geometry
|
The geometry the nodes are in. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
sensors |
list of Sensor
|
One per physical sensor, in the order of their first rows. |
notes |
list of str
|
Rows left out and why, models drawn as generic bodies, and triax legs the table gets wrong, each naming the node. |
Source code in src/visualdynamics/core/sensors.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |