python: add the position confidence ellipse for a cam - #575
Closed
tigroo wants to merge 2 commits into
Closed
Conversation
tigroo
force-pushed
the
position_ellipse_confidence
branch
from
July 31, 2026 10:27
81086c2 to
8f01c33
Compare
Use the CAM version 2.4.0. Signed-off-by: Frédéric Gardes <frederic.gardes@orange.com>
Fix the failing denm test on some contexts. Signed-off-by: Frédéric Gardes <frederic.gardes@orange.com>
tigroo
force-pushed
the
position_ellipse_confidence
branch
from
July 31, 2026 10:30
8f01c33 to
5ffb869
Compare
tigroo
marked this pull request as ready for review
July 31, 2026 10:47
ymorin-orange
requested changes
Aug 4, 2026
ymorin-orange
left a comment
Member
There was a problem hiding this comment.
Please split the huge commits into separate, atomic, and self-contained changes, each with its own rationale and explanation in the commit log.
| """ | ||
| tai_time = leapseconds.utc_to_tai( | ||
| datetime.datetime.utcfromtimestamp(unix_time) | ||
| datetime.datetime.fromtimestamp(unix_time, datetime.timezone.utc) |
Member
There was a problem hiding this comment.
Please add to the commit log that utcfromtimestamp() is deprecated since python 3.12, and should be replaced by calling fromtimestamp() with UTC as timezone.
tigroo
marked this pull request as draft
August 4, 2026 08:29
Member
|
As discussed IRL, I'll take on me to:
|
Member
|
I suggest we close this MR, after I opened #581. I'll let you do so if you agree. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Close #573
Close #574
Test
How to test
Note: in the following, lines starting with
$are to be executed on yourmachine, as a non-root user;
lines starting with
(docker)$are to be executed in the Docker container;lines starting with
(docker)🐍 $are to be executed in the Docker container,in the python venv.
Prepare a test environment:
be sure to have unrestricted access to test.mosquitto.org (IPv4 and IPv6)
be sure to have an MQTT broker that listens locally on port 1883,
with no credentials and no ACL; if not, run your own:
in another terminal, prepare a collector implementing
the OpenTelemetry API, on localhost. If you don't have one,
you may use an existing one, like:
then open a browser on the Jaegger UI
(or that of your own collector if you have one):
in another terminal, start a fake gpsd using Docker (gpsfake is not available in Ubuntu packages).
This docker provides gpsd-compatible JSON on port 2948 with RTK data (major=0.01m, minor=0.008m, orient=30°):
$ docker run -d --name gpsfake -p 2948:2947 \ --entrypoint python3 \ gpsfake -c " import socket, json, time, threading from datetime import datetime def create_tpv(lat, lon, alt=61.7, eph=0.5): return {'class':'TPV','device':'/dev/ttyUSB0','status':2,'mode':3, 'time':datetime.utcnow().isoformat()+'Z','lat':lat,'lon':lon, 'altHAE':alt,'eph':eph,'epv':eph*2,'track':31.66,'speed':0.02} def create_gst(major=0.01, minor=0.008, orient=30.0): return {'class':'GST','device':'/dev/ttyUSB0', 'time':datetime.utcnow().isoformat()+'Z', 'major':major,'minor':minor,'orient':orient,'rms':0.01} def create_att(): return {'class':'ATT','device':'/dev/ttyUSB0', 'time':datetime.utcnow().isoformat()+'Z', 'heading':31.66,'pitch':0,'roll':0,'acc_len':0,'magheading':31.66} s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) s.bind(('0.0.0.0',2947)); s.listen(1) while True: conn,addr=s.accept() threading.Thread(target=lambda c=conn: ( c.send(b'{\"class\":\"DEVICES\",\"devices\":[]}\n'), [c.send((json.dumps(create_tpv(53.3613,6.5056))+'\n').encode()) or c.send((json.dumps(create_gst()))+'\n').encode() or c.send((json.dumps(create_att()))+'\n').encode() or time.sleep(0.1) for _ in range(100) ), daemon=True).start() "in another terminal, start a container with Python 3.11
and the necessary packages.
The socat command exposes the MQTT broker listening
on
localhost:1883(see 1.2., above), inside thecontainer listening on the UNIX socket
/tmp/mqtt.socket:prepare a Python 3.11 environment, with tests dependencies
and packages' dependencies.
We install the packages dependencies manually,
and do not rely on pip to do so, because our Python packages depend
one on the others by git hash, as they are not published on PyPi yet,
so installing one of our packages may overwrite another:
Build the Python packages:
Install the Python packages:
(docker)🐍 $ pip --disable-pip-version-check --no-cache-dir \ install --no-deps python/*/dist/*.whlRun the IoT3 Core SDK tests:
Expected results
test-iot3-mobility-messageoutputs: