Orange-OpenSource / Orange-OpenSource/its-client

Compute acceleration from perceived object velocity

Open
#416 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue Rust
Dominant language
Java
Stars
19
Forks
12
Avg merge
6d 8h
Merged PRs (30d)
3

Description

Find how to compute a PerceivedObject acceleration from the full CPM data.

rust/src/mobility/mobile_perceived_object.rs, line 95:


impl MobilePerceivedObject {
    // TODO FGA: check how to keep it private and manage end to end CPMs with natively
    //           perceived object mobility
    pub(crate) fn new(
        perceived_object: PerceivedObject,
        cpm: &CollectivePerceptionMessage,
    ) -> Self {
        let mobile_id = compute_id(perceived_object.object_id, cpm.station_id);
        let cartesian_velocity = &perceived_object
            .velocity
            .as_ref()
            .and_then(|v| v.cartesian_velocity.as_ref())
            .map_or(CartesianVelocity::default(), |v| v.clone());
        let speed = speed_from_yaw_angle(
            cartesian_velocity.x_velocity.value,
            cartesian_velocity.y_velocity.value,
        );
        let (position, heading) = match &cpm.originating_vehicle_container {
            Some(_) => {
                let cpm_heading = cpm.heading().unwrap_or_default();
                // If the CPM has an originating vehicle container, we compute the heading
                // from the perceived object and the vehicle's heading.
                (
                    compute_position_from_mobile(
                        perceived_object.position.x_coordinate.value,
                        perceived_object.position.y_coordinate.value,
                        &cpm.position(),
                        cpm_heading,
                    ),
                    compute_heading_from_mobile(
                        cartesian_velocity.x_velocity.value,
                        cartesian_velocity.y_velocity.value,
                        cpm_heading,
                    ),
                )
            }
            None => {
                // If there is no originating vehicle container, we compute from the RSU
                (
                    enu_destination(
                        &cpm.position(),
                        perceived_object.position.x_coordinate.value as f64 / 100.,
                        perceived_object.position.y_coordinate.value as f64 / 100.,
                        perceived_object
                            .position
                            .z_coordinate
                            .unwrap_or_default()
                            .value as f64
                            / 100.,
                    ),
                    compute_heading_from_rsu(
                        cartesian_velocity.x_velocity.value,
                        cartesian_velocity.y_velocity.value,
                    ),
                )
            }
        };
        // FIXME compute acceleration from perceived object velocity. See https://github.com/Orange-OpenSource/its-client/issues/416
        let acceleration = 0.0;

        Self {
            perceived_object,
            mobile_id,
            position,
            speed,
            heading,
            acceleration,
        }
    }
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in rust/src/mobility/mobile_perceived_object.rs at MobilePerceivedObject::new and inspect how the full CPM data and perceived-object velocity are represented. Determine how acceleration should be derived from that data, replace the placeholder value, and verify that MobilePerceivedObject exposes the computed acceleration correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.