Mario Kart Live: Home Circuit: Difference between revisions
Cmdblkster (talk | contribs) m Added new information about the "product_code" parameter |
→Type 0x01: Battery Status: First byte actually indicates cable status |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 171: | Line 171: | ||
|- | |- | ||
|5107 | |5107 | ||
|" | |Unknown ("Event"?) RCD service | ||
|0x0103 | |0x0103 | ||
|- | |- | ||
Line 427: | Line 427: | ||
=== Teleoperation === | === Teleoperation === | ||
The kart is operated over UDP port 5102. This port is only open when the kart is in [[ | The kart is operated over UDP port 5102. This port is only open when the kart is in [[#Command 0x04: SetState|drive state]]. It expects packets of the form: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 479: | Line 479: | ||
|- | |- | ||
|0x0 | |0x0 | ||
| | |0x1 | ||
|Cable status bitmask: 0x1 = Cable connected; 0x2 = Unknown; 0x4 = Unknown | |||
|- | |||
|0x1 | |||
|0x2 | |||
|Zero padding | |Zero padding | ||
|- | |- | ||
Line 510: | Line 514: | ||
|0x2 | |0x2 | ||
|0x1 | |0x1 | ||
| colspan="2" |Flags bitfield: | | colspan="2" |Flags bitfield: IGA??NNN. I/G/A=High-precision units used, ?=Unknown, possibly clipping indicators. N=Number of IMU samples. | ||
|- | |- | ||
|0x3 | |0x3 | ||
Line 527: | Line 531: | ||
|0xC | |0xC | ||
|Integrator A position | |Integrator A position | ||
| rowspan="2" |s32 x, y, z; gives an estimate of total displacement since this integrator was reset. Units: | | rowspan="2" |s32 x, y, z; gives an estimate of total displacement since this integrator was reset. Every 6ms step: pos += vel>>12; Units: (4096*0.006)² * 2^-30 m (I=1), 78.4348 * (4096*0.006)² * 2^-30 m (I=0) | ||
|- | |- | ||
|0x24 | |0x24 | ||
Line 536: | Line 540: | ||
|0xC | |0xC | ||
|Integrator A velocity | |Integrator A velocity | ||
| rowspan="2" |s32 x, y, z; gives an estimate of total change in velocity since this integrator was reset. Units: | | rowspan="2" |s32 x, y, z; gives an estimate of total change in velocity since this integrator was reset. Every 6ms step: vel += acc>>12; (where 'acc' is acceleration in 2^-30 m/s²). Units: (4096*0.006) * 2^-30 m/s (I=1), 78.4348 * (4096*0.006) * 2^-30 m/s (I=0) | ||
|- | |- | ||
|0x3C | |0x3C | ||
Line 545: | Line 549: | ||
| rowspan="2" |0xC*(NNN+1) | | rowspan="2" |0xC*(NNN+1) | ||
| rowspan="2" |1-8 raw IMU samples | | rowspan="2" |1-8 raw IMU samples | ||
|s16 accel_x, accel_y, accel_z; // | |s16 accel_x, accel_y, accel_z; // Units: 9.81/4096 m/s² (A=1), 15.99*9.81/4096 m/s² (A=0) (9.81m/s² added to accel_z to compensate for gravity) | ||
|- | |- | ||
|s16 ang_vel_x, ang_vel_y, ang_vel_z; // | |s16 ang_vel_x, ang_vel_y, ang_vel_z; // Units: 0.004375 °/s (G=1), 0.1 °/s (G=0) | ||
|} | |} | ||
Line 554: | Line 558: | ||
The IMU itself is mounted on the PCB "upside down" which gives a reference frame different from what one would expect: While +X does correspond to the driver's right-hand side, the +Y vector extends beyond the rear of the vehicle, and +Z extends out the bottom. All measurements are taken with respect to this reference frame. | The IMU itself is mounted on the PCB "upside down" which gives a reference frame different from what one would expect: While +X does correspond to the driver's right-hand side, the +Y vector extends beyond the rear of the vehicle, and +Z extends out the bottom. All measurements are taken with respect to this reference frame. | ||
The orientation quaternion is reasonably stable, but should still only be trusted for relative measurements over short periods of time, as the quaternion can drift due to error (noise, clipping, quantization) in the IMU samples. The quaternion is initialized to | The orientation quaternion is reasonably stable, but should still only be trusted for relative measurements over short periods of time, as the quaternion can drift due to error (noise, clipping, quantization) in the IMU samples. The quaternion is initialized to 0i+0j+0k+1 once the IMU is enabled (i.e. when "connection_info" is set). | ||
The integrators are useful in an environment where packet loss is expected to be reasonably high, and so not all raw IMU samples can be reliably collected. The integrators are periodically reset (every 0x2000 samples), as they will accumulate error over time. | The integrators are useful in an environment where packet loss is expected to be reasonably high, and so not all raw IMU samples can be reliably collected. The integrators are periodically reset (every 0x2000 samples), as they will accumulate error over time. | ||
Both integrators are reset at the same time when the IMU is enabled, but integrator A is reset at sample 0x1000 so that the resets are staggered. | Both integrators are reset at the same time when the IMU is enabled, but integrator A is reset at sample 0x1000 so that the resets are staggered. | ||
==== Type 0x03: Motion feedback ==== | ==== Type 0x03: Motion feedback ==== |