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
5f681adb
Commit
5f681adb
authored
7 years ago
by
Davis, Duane T
Browse files
Options
Downloads
Patches
Plain Diff
LIB: Added enums & bitmapped message types for overwatch and delayed attack
parent
5e006410
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ap_lib/src/ap_lib/ap_enumerations.py
+7
-1
7 additions, 1 deletion
ap_lib/src/ap_lib/ap_enumerations.py
ap_lib/src/ap_lib/bitmapped_bytes.py
+42
-0
42 additions, 0 deletions
ap_lib/src/ap_lib/bitmapped_bytes.py
with
49 additions
and
1 deletion
ap_lib/src/ap_lib/ap_enumerations.py
+
7
−
1
View file @
5f681adb
...
@@ -109,7 +109,9 @@ TACTIC_INTERFACE = 15 # Use generic tactic interface
...
@@ -109,7 +109,9 @@ TACTIC_INTERFACE = 15 # Use generic tactic interface
EVADER
=
16
# Move to a waypoint while avoiding enemies
EVADER
=
16
# Move to a waypoint while avoiding enemies
SIMPLE_GRND_ATTACK
=
17
# Basic ground attack behavior (just land there)
SIMPLE_GRND_ATTACK
=
17
# Basic ground attack behavior (just land there)
WAVE_ATTACK
=
18
# Formation flyin and sequential drop
WAVE_ATTACK
=
18
# Formation flyin and sequential drop
FIXED_TURN
=
19
# Simple test behavior for turn-rate control capability
DELAYED_ATTACK
=
19
# Time delay between individual attacks one one location
OVERWATCH_ATTACK
=
20
# Formation flyin and sequential drop with highboy overwatch
FIXED_TURN
=
97
# Simple test behavior for turn-rate control capability
SWARM_SEQUENCE_LAND
=
98
# Land in order (low-to-high UAV)
SWARM_SEQUENCE_LAND
=
98
# Land in order (low-to-high UAV)
SWARM_EGRESS
=
99
# Egress the swarm for recovery
SWARM_EGRESS
=
99
# Egress the swarm for recovery
...
@@ -134,6 +136,8 @@ SWARM_BHVRS = { SWARM_STANDBY: 'Standby', \
...
@@ -134,6 +136,8 @@ SWARM_BHVRS = { SWARM_STANDBY: 'Standby', \
PATROL_BOX_SHOOTER
:
'
Patrol Box Shooter
'
,
\
PATROL_BOX_SHOOTER
:
'
Patrol Box Shooter
'
,
\
SIMPLE_GRND_ATTACK
:
'
Simple Grnd Attack
'
,
\
SIMPLE_GRND_ATTACK
:
'
Simple Grnd Attack
'
,
\
WAVE_ATTACK
:
'
Wave Grnd Attack
'
,
\
WAVE_ATTACK
:
'
Wave Grnd Attack
'
,
\
DELAYED_ATTACK
:
'
Delayed Grnd Attack
'
,
\
OVERWATCH_ATTACK
:
'
Overwatch Grnd Attack
'
,
\
FIXED_TURN
:
'
Fixed Turn
'
}
FIXED_TURN
:
'
Fixed Turn
'
}
SWARM_BHVR_VALUES
=
{
'
Standby
'
:
SWARM_STANDBY
,
\
SWARM_BHVR_VALUES
=
{
'
Standby
'
:
SWARM_STANDBY
,
\
...
@@ -156,6 +160,8 @@ SWARM_BHVR_VALUES = { 'Standby': SWARM_STANDBY, \
...
@@ -156,6 +160,8 @@ SWARM_BHVR_VALUES = { 'Standby': SWARM_STANDBY, \
'
Tactic Interface
'
:
TACTIC_INTERFACE
,
\
'
Tactic Interface
'
:
TACTIC_INTERFACE
,
\
'
Simple Grnd Attack
'
:
SIMPLE_GRND_ATTACK
,
\
'
Simple Grnd Attack
'
:
SIMPLE_GRND_ATTACK
,
\
'
Wave Grnd Attack
'
:
WAVE_ATTACK
,
\
'
Wave Grnd Attack
'
:
WAVE_ATTACK
,
\
'
Delayed Grnd Attack
'
:
DELAYED_ATTACK
,
\
'
Overwatch Grnd Attack
'
:
OVERWATCH_ATTACK
,
\
'
Fixed Turn
'
:
FIXED_TURN
}
'
Fixed Turn
'
:
FIXED_TURN
}
# Enumeration for swarming states
# Enumeration for swarming states
...
...
This diff is collapsed.
Click to expand it.
ap_lib/src/ap_lib/bitmapped_bytes.py
+
42
−
0
View file @
5f681adb
...
@@ -629,6 +629,48 @@ class GroundAttackOrderParser(BitmappedBytes):
...
@@ -629,6 +629,48 @@ class GroundAttackOrderParser(BitmappedBytes):
self
.
runin_direction
=
fields
[
3
]
/
1e03
self
.
runin_direction
=
fields
[
3
]
/
1e03
class
DelayedGroundAttackOrderParser
(
BitmappedBytes
):
'''
Parser for ground attack orders
'''
fmt
=
"
>llllH2x
"
def
__init__
(
self
):
'''
Initializes parameters with default values
'''
self
.
latitude
=
0.0
# 7-decimal precision degrees
self
.
longitude
=
0.0
# 7-decimal precision degrees
self
.
release_altitude
=
0.0
# 2-decimal precision meters MSL
self
.
runin_direction
=
0.0
# 3-decimal precision degrees
self
.
delay
=
0
# Seconds between drops
def
pack
(
self
):
'''
Serializes parameter values into a bitmapped byte array
@return bitmapped bytes as a string
'''
tupl
=
(
int
(
self
.
latitude
*
1e07
),
\
int
(
self
.
longitude
*
1e07
),
\
int
(
self
.
release_altitude
*
1e02
),
\
int
(
self
.
runin_direction
*
1e03
),
\
int
(
self
.
delay
))
return
struct
.
pack
(
type
(
self
).
fmt
,
*
tupl
)
def
unpack
(
self
,
bytes
):
'''
Sets parameter values from a bitmapped byte array
@param bytes: bitmapped byte array
'''
fields
=
struct
.
unpack_from
(
type
(
self
).
fmt
,
bytes
,
0
)
# Place unpacked but unconverted fields into message elements
self
.
latitude
=
fields
[
0
]
/
1e07
self
.
longitude
=
fields
[
1
]
/
1e07
self
.
release_altitude
=
fields
[
2
]
/
1e02
self
.
runin_direction
=
fields
[
3
]
/
1e03
self
.
delay
=
fields
[
4
]
class
FiringReportParser
(
BitmappedBytes
):
class
FiringReportParser
(
BitmappedBytes
):
'''
Parser for firing report messages orders
'''
Parser for firing report messages orders
'''
'''
...
...
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