Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(simple_planning_simulator, raw_vehicle_cmd_converter): swap row index and column index for csv loader #8963

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

go-sakayori
Copy link
Contributor

Description

Both the simple_planning_simulator and autoware_raw_vehicle_cmd_converter package has a CSV loader class.
As a member function they have getRowIndex and getColumnIndex.
However, the getRowIndex seems to read index for columns, and the getColumnIndex seems to read index for rows.
These functions have been swapped in this PR.

Furthermore, some refactoring was made based on clang tidy.

Related links

None

How was this PR tested?

Was able to drive autonomously in PSim.
Screenshot from 2024-09-26 13-38-17

Parameters were changed as below:
simulator_model.param.yaml

/**:
  ros__parameters:
    simulated_frame_id: "base_link"
    origin_frame_id: "map"
    vehicle_model_type: "ACTUATION_CMD"
    initialize_source: "INITIAL_POSE_TOPIC"
    timer_sampling_time_ms: 25
    add_measurement_noise: False
    enable_road_slope_simulation: True
    vel_lim: 50.0
    vel_rate_lim: 7.0
    steer_lim: 1.0
    steer_rate_lim: 5.0
    acc_time_delay: 0.1
    acc_time_constant: 0.1
    steer_time_delay: 0.24
    steer_time_constant: 0.27
    steer_dead_band: 0.0012
    x_stddev: 0.0001 # x standard deviation for dummy covariance in map coordinate
    y_stddev: 0.0001 # y standard deviation for dummy covariance in map coordinate

    accel_time_delay: 0.1
    accel_time_constant: 0.1
    brake_time_delay: 0.1
    brake_time_constant: 0.1
    accel_map_path: $(find-pkg-share simple_planning_simulator)/data/actuation_cmd_map/accel_map.csv
    brake_map_path: $(find-pkg-share simple_planning_simulator)/data/actuation_cmd_map/brake_map.csv
    steer_map_path: $(find-pkg-share simple_planning_simulator)/data/actuation_cmd_map/steer_map.csv
    convert_accel_cmd: true
    convert_brake_cmd: true
    convert_steer_cmd: true

    convert_steer_cmd_method: "vgr"
    vgr_coef_a: 15.713
    vgr_coef_b: 0.053
    vgr_coef_c: 0.042
    enable_pub_steer: true

raw_vehicle_cmd_converter.param.yaml

/**:
  ros__parameters:
    csv_path_accel_map: $(find-pkg-share autoware_raw_vehicle_cmd_converter)/data/default/accel_map.csv
    csv_path_brake_map: $(find-pkg-share autoware_raw_vehicle_cmd_converter)/data/default/brake_map.csv
    csv_path_steer_map: $(find-pkg-share autoware_raw_vehicle_cmd_converter)/data/default/steer_map.csv
    convert_accel_cmd: true
    convert_brake_cmd: true
    convert_steer_cmd: true
    use_steer_ff: true
    use_steer_fb: true
    is_debugging: false
    max_throttle: 0.4
    max_brake: 0.8
    max_steer: 10.0
    min_steer: -10.0
    steer_pid:
      kp: 150.0
      ki: 15.0
      kd: 0.0
      max: 8.0
      min: -8.0
      max_p: 8.0
      min_p: -8.0
      max_i: 8.0
      min_i: -8.0
      max_d: 0.0
      min_d: 0.0
      invalid_integration_decay: 0.97
    convert_steer_cmd_method: "vgr"  # "vgr" or "steer_map"
    vgr_coef_a: 15.713
    vgr_coef_b: 0.053
    vgr_coef_c: 0.042
    convert_actuation_to_steering_status: false

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: Go Sakayori <gsakayori@gmail.com>
@github-actions github-actions bot added component:vehicle Vehicle-specific implementations, drivers, packages. (auto-assigned) component:simulation Virtual environment setups and simulations. (auto-assigned) labels Sep 26, 2024
Copy link

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

Copy link
Contributor

@kosuke55 kosuke55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kosuke55 kosuke55 added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Sep 26, 2024
Copy link
Contributor

@soblin soblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

  • swap column/row
  • use reserve before push_back for perf

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.

Project coverage is 28.42%. Comparing base (9fd0dae) to head (fc8463e).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...cle_model/sim_model_delay_steer_map_acc_geared.hpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8963      +/-   ##
==========================================
- Coverage   28.48%   28.42%   -0.06%     
==========================================
  Files        1314     1316       +2     
  Lines       98292    98386      +94     
  Branches    39995    40004       +9     
==========================================
- Hits        27999    27968      -31     
- Misses      70228    70353     +125     
  Partials       65       65              
Flag Coverage Δ *Carryforward flag
differential 22.43% <91.30%> (?)
total 28.44% <ø> (-0.05%) ⬇️ Carriedforward from 9fd0dae

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@go-sakayori go-sakayori merged commit 65a36d4 into autowarefoundation:main Sep 26, 2024
42 checks passed
@go-sakayori go-sakayori deleted the fix/csv_loader branch September 26, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:simulation Virtual environment setups and simulations. (auto-assigned) component:vehicle Vehicle-specific implementations, drivers, packages. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants