Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autonomy-payload
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SASC
autonomy-payload
Commits
25471fac
Commit
25471fac
authored
7 years ago
by
Davis, Duane T
Browse files
Options
Downloads
Patches
Plain Diff
ap_lib: Added a contains method (sector containment of a third angle)
parent
3a5ee79a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ap_lib/src/ap_lib/math_utils.py
+13
-0
13 additions, 0 deletions
ap_lib/src/ap_lib/math_utils.py
with
13 additions
and
0 deletions
ap_lib/src/ap_lib/math_utils.py
+
13
−
0
View file @
25471fac
...
@@ -100,6 +100,19 @@ def normalize_pi(angle):
...
@@ -100,6 +100,19 @@ def normalize_pi(angle):
return
angle
return
angle
def
sector_contains
(
min_angle
,
max_angle
,
test_angle
):
'''
Tests whether or not a test angle lies in a particular heading
sector (i.e., does a heading sweap from the sector min to the sector
max pass through the test angle). A test angle lying on the sector
edge is NOT contained. All angles are normalized to a range of [0, 2pi).
@param min_angle: angle (radians) defining the start of the sector
@param max_angle: angle (radians) defining the end of the sector
@param test_angle: angle (radians) being tested
@returns True if the test angle lies between the min and max angle
'''
return
normalize
(
test_angle
-
min_angle
)
<
normalize
(
max_angle
-
min_angle
)
# Vector functions
# Vector functions
def
scalar_multiply
(
v1
,
s
):
def
scalar_multiply
(
v1
,
s
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment