GNSS course worked out server-side (App.gnss_update, for the CAN node and the simulation, which send none): following in 3D turns heading-up behind the position again
This commit is contained in:
1 parent
f65eb98d18
commit
8680cdbee7
4 files changed
+62
-6
No files matched your search
@@ -662,6 +662,23 @@ class AppTest < Minitest::Test
|
||||
assert_equal 404, response.status
|
||||
end
|
||||
|
||||
def test_a_gnss_fix_without_a_course_gets_one_from_the_fixes_before
|
||||
latest = Maptool::App::GNSS_LATEST
|
||||
latest.clear
|
||||
step = 10.0 / 111_320 # 10 m north each fix
|
||||
Maptool::App.gnss_update({ lat: 48.0, lon: 17.0, speed: 10.0 })
|
||||
assert_nil latest[:track]
|
||||
Maptool::App.gnss_update({ lat: 48.0 + step, lon: 17.0 })
|
||||
assert_in_delta 0.0, latest[:track], 0.1
|
||||
Maptool::App.gnss_update({ lat: 48.0 + step, lon: 17.0 + step / Math.cos(48 * Math::PI / 180) })
|
||||
assert_in_delta 90.0, latest[:track], 0.5
|
||||
Maptool::App.gnss_update({ speed: 0.0 })
|
||||
Maptool::App.gnss_update({ lat: 48.0, lon: 17.0 }) # standing still: the course stays
|
||||
assert_in_delta 90.0, latest[:track], 0.5
|
||||
ensure
|
||||
latest.clear
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def upload(filename, content, folder: "", content_type: "application/octet-stream")
|
||||
|
||||
Reference in new issue
Block a user