Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
New physics sensor to Roll/Pitch/Yaw
   
Award
Favorite
Favorited
Unfavorite
Tags: v1.6.14
File Size
Posted
Updated
26.663 KB
19 Feb, 2023 @ 8:33am
19 Feb, 2023 @ 8:38am
4 Change Notes ( view )

Subscribe to download
New physics sensor to Roll/Pitch/Yaw

Description
This example gets roll/pitch/yaw from new physics sensor.

The output can be selected btw radians and degrees.

The degrees output for yaw is 0~360 value, while radians output -pi ~ pi.

By resizing the microcontroller, it can be easily changed to composite version.
3 Comments
Justyourchamp 1 Jun, 2023 @ 12:40am 
Thank you so much gigachad moment
TT 5 Mar, 2023 @ 12:54pm 
This is spectacular! This should be far more popular given it doesn't seem to suffer from the issues of currently more popular solutions to the problem.
Christopher Courage 21 Feb, 2023 @ 2:38pm 
Hello, I downloaded your creation and it's one of, if not the best example on the workshop. I know it's a bit cheeky, but is there any way you could explain how your code turns the Physics Sensor outputs into degrees?

I've tried analysing your code, but I'm relatively inexperienced when it comes to both coding and mathematics at this level. I simply tried:

output.setNumber(1, xx) xx = math.abs(((x * 180) / math.pi) - 180)

Which outputs all but the yaw into a value from 0 - 360 degrees, but when I drive around, the change in yaw affects the pitch and roll values. Am I missing something fundamental and are people right in saying the Yaw / Channel 5 is currently broken?

I assume your code compensates for this, but unfortunately I can't figure it out.

Many thanks!