Stormworks: Build and Rescue

Stormworks: Build and Rescue

评价数不足
New physics sensor to Roll/Pitch/Yaw
   
奖励
收藏
已收藏
取消收藏
标签: v1.6.14
文件大小
发表于
更新日期
26.663 KB
2023 年 2 月 19 日 上午 8:33
2023 年 2 月 19 日 上午 8:38
4 项改动说明 ( 查看 )

订阅以下载
New physics sensor to Roll/Pitch/Yaw

描述
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 条留言
Justyourchamp 2023 年 6 月 1 日 上午 12:40 
Thank you so much gigachad moment
TT 2023 年 3 月 5 日 下午 12:54 
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 2023 年 2 月 21 日 下午 2:38 
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!