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

Using util.angle_mod in all codes. #684 #946

Merged
merged 12 commits into from
Jan 2, 2024

Conversation

videh25
Copy link
Contributor

@videh25 videh25 commented Dec 1, 2023

fix #684

As suggested in the issue, searched for instances for wrapping an angle between -pi to pi and modified the code to use util.angle_mod. Searched .pi throughout all the files to identify lines where angle_mod() is implemented again.

Summary of instances found:

File name Function name/Line number Action Taken
ArmNavigation/n_joint_arm_to_point_control/n_joint_arm_to_point_control.py ang_diff Modified
ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py ang_diff Modified
Control/move_to_pose/move_to_pose.py Line 71 Modified
Localization/ensemble_kalman_filter/ensemble_kalman_filter.py pi_2_pi Modified
PathPlanning/ClosedLoopRRTStar/unicycle_model.py pi_2_pi Modified
PathPlanning/ModelPredictiveTrajectoryGenerator/motion_model.py pi_2_pi Modified
PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py mod2pi Deleted (Redundant)
PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py pi_2_pi Modified
PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py pi_2_pi Modified
PathTracking/lqr_steer_control/lqr_steer_control.py pi_2_pi Modified
PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py pi_2_pi Modified
PathTracking/rear_wheel_feedback/rear_wheel_feedback.py pi_2_pi Modified
PathTracking/stanley_controller/stanley_controller.py normalize_angle Modified
SLAM/EKFSLAM/ekf_slam.py pi_2_pi Modified
SLAM/FastSLAM1/fast_slam1.py pi_2_pi Modified
SLAM/FastSLAM2/fast_slam2.py pi_2_pi Modified
SLAM/GraphBasedSLAM/graph_based_slam.py pi_2_pi Modified
SLAM/GraphBasedSLAM/graphslam/util.py neg_pi_to_pi No Action Taken (External Lib)

I hope this helps in review.

I am new to OSS contributions, please let me know if I am missing anything. Thanks for bearing with me! ^_^

CheckList

  • Did you add an unittest for your new example or defect fix?
  • Did you add documents for your new example?
  • All CIs are green? (You can check it after submitting)

Copy link
Owner

@AtsushiSakai AtsushiSakai left a comment

Choose a reason for hiding this comment

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

Thank you for PR.
Please fix CI error first:

=================================== FAILURES ===================================
_____________________________________ test _____________________________________
[gw3] linux -- Python 3.11.6 /opt/hostedtoolcache/Python/3.11.6/x64/bin/python

    def test():
        branch_commit = find_branch_point("origin/master")
        files = diff_files(branch_commit)
        print(files)
        rc, errors = run_ruff(files, fix=True)
        if errors:
            print(errors)
        else:
            print("No lint errors found.")
>       assert rc == 0
E       assert 1 == 0

branch_commit = '0dc6ab42bab4d3e2fb06fc[25](https://github.com/AtsushiSakai/PythonRobotics/actions/runs/7062067522/job/19257122187?pr=946#step:6:26)d86b1abe41d4da2a'
errors     = 'Control/move_to_pose/move_to_pose.py:181:15: UP0[31](https://github.com/AtsushiSakai/PythonRobotics/actions/runs/7062067522/job/19257122187?pr=946#step:6:32) Use format specifiers instead of percent format\nControl/move_to_p...errors (9 fixed, 3 remaining).\nNo fixes available (3 hidden fixes can be enabled with the `--unsafe-fixes` option).\n'
files      = ['/home/runner/work/PythonRobotics/PythonRobotics/ArmNavigation/n_joint_arm_to_point_control/n_joint_arm_to_point_cont...'/home/runner/work/PythonRobotics/PythonRobotics/PathPlanning/ModelPredictiveTrajectoryGenerator/motion_model.py', ...]
rc         = 1

@videh25
Copy link
Contributor Author

videh25 commented Dec 4, 2023

Fixed the CI errors as requested.

Copy link
Owner

@AtsushiSakai AtsushiSakai left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. I have some recommendations. PTAL.

Control/move_to_pose/move_to_pose.py Outdated Show resolved Hide resolved
Control/move_to_pose/move_to_pose.py Outdated Show resolved Hide resolved
@videh25 videh25 requested a review from AtsushiSakai December 19, 2023 10:43
Copy link
Owner

@AtsushiSakai AtsushiSakai left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for long discussion with me!!

@AtsushiSakai AtsushiSakai merged commit cc3fd0c into AtsushiSakai:master Jan 2, 2024
8 checks passed
@videh25 videh25 deleted the angle_mod branch January 3, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using util.angle_mod in all codes.
2 participants