Orange-OpenSource / its-client

This Intelligent Transportation Systems (ITS) MQTT client based on the JSon ETSI specification transcription provides a ready to connect project for the mobility (connected and autonomous vehicles, road side units, vulnerable road users,...). Let's connect your device or application to our Intelligent Transport Systems (ITS) platform!
MIT License
7 stars 8 forks source link

2.0.0 #119

Closed nbuffon closed 1 month ago

nbuffon commented 5 months ago

What's new

Rust

How to test

  1. Check workflow status => None must have failed

  2. Test MQTT example

    cargo run --example json_counter

    => The example must run successfully and log about message reception

    Received 1000 messages including 997 as JSON
    Received 2000 messages including 1997 as JSON
    Received 3000 messages including 2997 as JSON
    ...

  3. Test mobility example

    1. Edit the configuration to limit the analysis threads to 1

      [node]
      responsibility_enabled=true
      thread_count=1
    2. Launch the example

      cargo run --example copycat --features geo_routing

      => The example must run successfully

    3. Send a CAM message

      mosquitto_pub -h test.mosquitto.org -p 1884 -u rw -P readwrite -t default/outQueue/v2x/cam/ora_car_testcon1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1 -m '{"type":"cam","origin":"self","version":"1.2.0","source_uuid":"ora_car_1111","timestamp":1618591358923,"message":{"protocol_version":2,"station_id":1077952580,"generation_delta_time":31571,"basic_container":{"station_type":5,"reference_position":{"latitude":486230934,"longitude":22419064,"altitude":10000},"confidence":{"position_confidence_ellipse":{"semi_major_confidence":0,"semi_minor_confidence":0,"semi_major_orientation":0},"altitude":1}},"high_frequency_container":{"heading":2375,"speed":137,"drive_direction":0,"vehicle_length":47,"vehicle_width":24,"longitudinal_acceleration":1,"lateral_acceleration":0,"vertical_acceleration":0,"yaw_rate":-27,"lane_position":0,"curvature":0,"confidence":{"heading":2,"speed":3,"vehicle_length":1,"vehicle_width":1,"longitudinal_acceleration":5,"yaw_rate":6,"lane_position":1,"curvature":7}},"low_frequency_container":{"vehicle_role":0,"exterior_lights":"00000000","path_history":[{"path_position":{},"path_delta_time":1}]}}}'

      => The received CAM is scheduled for copy

      INFO [copycat] we start to schedule 1077952580 from ora_car_1111

    4. Wait a few seconds (more than 3)

    5. Send a second CAM

      mosquitto_pub -h test.mosquitto.org -p 1884 -u rw -P readwrite -t default/outQueue/v2x/cam/ora_car_testcon2/2/2/2/2/2/2/2/2/2/2/2/2/2/2/2/2/2/2/2 -m '{"type":"cam","origin":"self","version":"1.2.0","source_uuid":"ora_car_2222","timestamp":1618591358923,"message":{"protocol_version":2,"station_id":1077952580,"generation_delta_time":31571,"basic_container":{"station_type":5,"reference_position":{"latitude":486230934,"longitude":22419064,"altitude":10000},"confidence":{"position_confidence_ellipse":{"semi_major_confidence":0,"semi_minor_confidence":0,"semi_major_orientation":0},"altitude":1}},"high_frequency_container":{"heading":2375,"speed":137,"drive_direction":0,"vehicle_length":47,"vehicle_width":24,"longitudinal_acceleration":1,"lateral_acceleration":0,"vertical_acceleration":0,"yaw_rate":-27,"lane_position":0,"curvature":0,"confidence":{"heading":2,"speed":3,"vehicle_length":1,"vehicle_width":1,"longitudinal_acceleration":5,"yaw_rate":6,"lane_position":1,"curvature":7}},"low_frequency_container":{"vehicle_role":0,"exterior_lights":"00000000","path_history":[{"path_position":{},"path_delta_time":1}]}}}'

      => Second CAM is scheduled for copy

      INFO [copycat] we start to schedule 1077952580 from ora_car_2222

      => Previous received CAM is sent on inQueue

      INFO [copycat] we treat the scheduled item 1 1077952580 from ora_car_1111 ... DEBUG [rumqttc::v5::state] Publish. Topic = default/inQueue/v2x/cam/com_orange_its-client_10000/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1, Pkid = 2, Payload Size = 962

  4. Test telemetry example

    1. Start an OTLP collector / Jager container
      docker run --rm --name jaeger \
       -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
       -p 6831:6831/udp \
       -p 6832:6832/udp \
       -p 5778:5778 \
       -p 16686:16686 \
       -p 4317:4317 \
       -p 4318:4318 \
       -p 14250:14250 \
       -p 14268:14268 \
       -p 14269:14269 \
       -p 9411:9411 -d\
       jaegertracing/all-in-one:1.58
    2. Edit the example/config.ini file to uncomment and fill the [telemetry] section to fit your OTLP collector configuration
      [telemetry]
      host=localhost
      port=4318
    3. Launch the example
      cargo run --example telemetry --features telemetry

      => Example must correctly run and send several traces

      INFO [telemetry] Send a trace with a single span 'ping' root span
      INFO [telemetry] └─ Ping                  trace_id: 73b0fc6aaabcf9d813ba811ec0e6f4e9, span_id: 80d0f05d323e21dc
      INFO [telemetry] Send a trace with a single span 'pong' root span linked with the previous one 'ping'
      INFO [telemetry] └─ Pong                  trace_id: 63b0e226166e81abb7e45d7b091ab437, span_id: b6579019050f097a
      INFO [telemetry] Send a single trace with two spans
      INFO [telemetry] └─ Root                  trace_id: 05f21e2ac259df6971a8f2f02f82d048, span_id: 640ead7c47fa77b2
      INFO [telemetry]    └─ Child              trace_id: 05f21e2ac259df6971a8f2f02f82d048, span_id: 155b1c980c506de4
      INFO [telemetry] Send a trace with 3 spans from 3 threads
      INFO [telemetry] └─ Main thread           trace_id: fe214e7d590290f88de05a0eb116dd6d, span_id: 21ebad2f7da3d157
      INFO [telemetry]    ├─ Sender thread      trace_id: fe214e7d590290f88de05a0eb116dd6d, span_id: 2fafb0feacea9e5a
      INFO [telemetry]    └─ Listener thread    trace_id: fe214e7d590290f88de05a0eb116dd6d, span_id:         1cf75b31cc5c0e70
    4. Check the Jaeger on localhost (http://localhost:16686/) => You must see the corresponding traces that the example logged about
tigroo commented 2 months ago

@nbuffon , how to finalize these works? I review? We close without merging?

ymorin-orange commented 1 month ago
  1. [x] No workflow in error
  2. [x] json_counter example works

    • There are build warnings:

      warning: associated function `new` is never used
        --> src/transport/mqtt/mqtt_router.rs:33:19
         |
      32 | impl MqttRouter {
         | --------------- associated function in this implementation
      33 |     pub(crate) fn new() -> MqttRouter {
         |                   ^^^
         |
         = note: `#[warn(dead_code)]` on by default
      
      warning: `libits-client` (lib) generated 1 warning
          Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s
           Running `target/debug/examples/json_counter`
  3. [x] copycat example works

    • There are build warnings:

      warning: function `acceleration_to_etsi` is never used
        --> src/exchange/etsi.rs:83:15
         |
      83 | pub(crate) fn acceleration_to_etsi(m_per_s_2: f64) -> i16 {
         |               ^^^^^^^^^^^^^^^^^^^^
         |
         = note: `#[warn(dead_code)]` on by default
      
      warning: function `timestamp_from_etsi` is never used
        --> src/exchange/etsi.rs:87:15
         |
      87 | pub(crate) fn timestamp_from_etsi(etsi_timestamp: u64) -> u64 {
         |               ^^^^^^^^^^^^^^^^^^^
      
      warning: `libits-client` (lib) generated 2 warnings
          Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.71s
           Running `target/debug/examples/copycat`
  4. [x] telemetry example works

    • There are build warnings:

      warning: associated function `new` is never used
        --> src/transport/mqtt/mqtt_router.rs:33:19
         |
      32 | impl MqttRouter {
         | --------------- associated function in this implementation
      33 |     pub(crate) fn new() -> MqttRouter {
         |                   ^^^
         |
         = note: `#[warn(dead_code)]` on by default
      
      warning: `libits-client` (lib) generated 1 warning
          Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s
           Running `target/debug/examples/telemetry`
ymorin-orange commented 1 month ago

There is a conflict on THIRD-PARTY.md. Please rebase and resolve the conflict before pushing again.

nbuffon commented 1 month ago

There is a conflict on THIRD-PARTY.md. Please rebase and resolve the conflict before pushing again.

Sure, I already did the rebase, I was waiting for a cue from your side to push it I'll also fix the warnings, either by real fix or by FIXMEing using an issue reference

nbuffon commented 1 month ago

I added 3 new commits, that you can review, to fix the workflow issue, and the build warnings