Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SRC OBDH TMTC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robin Mueller
SRC OBDH TMTC
Commits
7c4a95ab
Commit
7c4a95ab
authored
5 years ago
by
Robin.Mueller
Browse files
Options
Downloads
Patches
Plain Diff
service 3 fixes
parent
3af782d2
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
config/obsw_config.py
+4
-1
4 additions, 1 deletion
config/obsw_config.py
tc/obsw_tc_service3.py
+1
-1
1 addition, 1 deletion
tc/obsw_tc_service3.py
tm/obsw_tm_service_3.py
+48
-24
48 additions, 24 deletions
tm/obsw_tm_service_3.py
tmtc_core
+1
-1
1 addition, 1 deletion
tmtc_core
with
54 additions
and
27 deletions
config/obsw_config.py
+
4
−
1
View file @
7c4a95ab
...
...
@@ -23,6 +23,9 @@ Mission/Device specific information.
GPS0_DEVICE_ID
=
bytearray
([
0x44
,
0x10
,
0x1F
,
0x00
])
GPS1_DEVICE_ID
=
bytearray
([
0x44
,
0x20
,
0x20
,
0x00
])
DUMMY_DEVICE_ID
=
bytearray
([
0x44
,
0x00
,
0xAF
,
0xFE
])
THERMAL_SENSOR_DEVICE_ID
=
bytearray
([
0x44
,
0x11
,
0x54
,
0x00
])
GYRO_DEVICE_ID
=
bytearray
([
0x44
,
0x11
,
0x55
,
0x00
])
TEST_TASK_ID
=
bytearray
([
0x42
,
0x69
,
0x42
,
0x69
])
SD_CARD_HANDLER_ID
=
bytearray
([
0x4D
,
0x00
,
0x73
,
0xAD
])
# Commands
...
...
@@ -32,7 +35,7 @@ DUMMY_COMMAND_2_PARAM_1 = bytearray([0xBA, 0xB0])
DUMMY_COMMAND_2_PARAM_2
=
bytearray
([
0x00
,
0x00
,
0x00
,
0x52
,
0x4F
,
0x42
,
0x49
,
0x4E
])
DUMMY_COMMAND_3
=
bytearray
([
0xBA
,
0xDE
,
0xAF
,
0xFE
])
# SIDs
# SIDs
(obsolete..)
GPS0_SID
=
bytearray
([
0x00
,
0x00
,
0x1f
,
0x00
])
GPS1_SID
=
bytearray
([
0x00
,
0x00
,
0x2f
,
0x00
])
TEST_SID
=
bytearray
([
0x00
,
0x00
,
0x43
,
0x00
])
...
...
This diff is collapsed.
Click to expand it.
tc/obsw_tc_service3.py
+
1
−
1
View file @
7c4a95ab
...
...
@@ -15,7 +15,7 @@ sid_test = g.TEST_SID
sid_custom
=
g
.
CUSTOM_SID
sid_gps
=
g
.
GPS0_SID
collection_interval_hk
=
struct
.
pack
(
'
>f
'
,
3
)
collection_interval_diag
=
struct
.
pack
(
'
>f
'
,
0.8
)
collection_interval_diag
=
struct
.
pack
(
'
>f
'
,
0.8
)
number_of_parameters
=
struct
.
pack
(
'
>B
'
,
5
)
p1
=
g
.
TEST_ID_1
p2
=
g
.
TEST_ID_2
...
...
This diff is collapsed.
Click to expand it.
tm/obsw_tm_service_3.py
+
48
−
24
View file @
7c4a95ab
...
...
@@ -10,6 +10,7 @@ from tmtc_core.tm.obsw_pus_tm_base import PusTelemetry
from
typing
import
Type
from
tmtc_core.utility.obsw_logger
import
get_logger
import
struct
import
config.obsw_config
as
g
LOGGER
=
get_logger
()
...
...
@@ -18,7 +19,10 @@ class Service3TM(PusTelemetry):
def
__init__
(
self
,
byte_array
:
bytearray
):
super
().
__init__
(
byte_array
)
# print("Length of TM data: " + str(len(self._tm_data)))
self
.
sid
=
struct
.
unpack
(
'
>I
'
,
self
.
_tm_data
[
0
:
4
])[
0
]
self
.
print_source_data
()
self
.
objectId
=
struct
.
unpack
(
'
!I
'
,
self
.
_tm_data
[
0
:
4
])[
0
]
self
.
objectIdRaw
=
self
.
_tm_data
[
0
:
4
]
self
.
setId
=
struct
.
unpack
(
'
!I
'
,
self
.
_tm_data
[
4
:
8
])[
0
]
self
.
hkHeader
=
[]
self
.
hkContent
=
[]
self
.
hkDefinitionHeader
=
[]
...
...
@@ -34,16 +38,19 @@ class Service3TM(PusTelemetry):
def
append_telemetry_content
(
self
,
array
):
super
().
append_telemetry_content
(
array
)
array
.
append
(
hex
(
self
.
sid
))
array
.
append
(
hex
(
self
.
objectId
))
array
.
append
(
hex
(
self
.
setId
))
array
.
append
(
int
(
self
.
paramLength
))
def
append_telemetry_column_headers
(
self
,
array
):
super
().
append_telemetry_column_headers
(
array
)
array
.
append
(
"
SID
"
)
array
.
append
(
"
Object ID
"
)
array
.
append
(
"
Set ID
"
)
array
.
append
(
"
HK Data Size
"
)
def
handle_filling_definition_arrays
(
self
):
self
.
hkHeader
=
[
"
SID
"
,
"
Report Status
"
,
"
Collection Interval
"
,
"
Number Of IDs
"
]
self
.
hkHeader
=
[
"
Object ID
"
,
"
Set ID
"
,
"
Report Status
"
,
"
Collection Interval
"
,
"
Number Of IDs
"
]
reporting_enabled
=
self
.
_tm_data
[
4
]
collection_interval
=
struct
.
unpack
(
'
>f
'
,
self
.
_tm_data
[
5
:
9
])[
0
]
number_of_params
=
self
.
_tm_data
[
9
]
...
...
@@ -58,15 +65,20 @@ class Service3TM(PusTelemetry):
status_string
=
"
On
"
else
:
status_string
=
"
Off
"
self
.
hkContent
=
[
hex
(
self
.
sid
),
status_string
,
collection_interval
,
number_of_params
]
self
.
hkContent
=
[
hex
(
self
.
objectId
),
self
.
setId
,
status_string
,
collection_interval
,
number_of_params
]
self
.
hkContent
.
extend
(
parameters
)
def
handle_filling_hk_arrays
(
self
):
self
.
paramLength
=
len
(
self
.
_tm_data
)
-
4
self
.
paramLength
=
len
(
self
.
_tm_data
)
-
8
# TODO: This can be automated by using the MIB parser pool names and pool datatypes
if
self
.
sid
==
0x1f00
or
self
.
sid
==
0x2f00
:
if
self
.
objectIdRaw
==
g
.
THERMAL_SENSOR_DEVICE_ID
:
self
.
handle_thermal_sensor_hk_data
()
elif
self
.
objectIdRaw
==
g
.
GYRO_DEVICE_ID
:
self
.
handle_gyro_hk_data
()
elif
self
.
objectIdRaw
==
g
.
GPS0_DEVICE_ID
or
self
.
objectId
==
g
.
GPS1_DEVICE_ID
:
self
.
handle_gps_hk_data
()
elif
self
.
sid
==
0x4300
or
self
.
sid
==
0x4400
:
elif
self
.
objectIdRaw
==
g
.
TEST_TASK_ID
:
self
.
handle_test_hk_data
()
else
:
LOGGER
.
info
(
"
Service 3 TM: Parsing for this SID has not been implemented.
"
)
...
...
@@ -77,21 +89,21 @@ class Service3TM(PusTelemetry):
self
.
hkHeader
=
[
"
Fix Mode
"
,
"
SV in Fix
"
,
"
GNSS Week
"
,
"
Time of Week
"
,
"
Latitude
"
,
"
Longitude
"
,
"
Mean Sea Altitude
"
,
"
Position X
"
,
"
Position Y
"
,
"
Position Z
"
,
"
Velocity X
"
,
"
Velocity Y
"
,
"
Velocity Z
"
]
fix
M
ode
=
self
.
_tm_data
[
4
]
sv
InF
ix
=
self
.
_tm_data
[
5
]
gnss
W
eek
=
struct
.
unpack
(
'
>H
'
,
self
.
_tm_data
[
6
:
8
])[
0
]
time
OfW
eek
=
struct
.
unpack
(
'
>I
'
,
self
.
_tm_data
[
8
:
12
])[
0
]
fix
_m
ode
=
self
.
_tm_data
[
4
]
sv
_in_f
ix
=
self
.
_tm_data
[
5
]
gnss
_w
eek
=
struct
.
unpack
(
'
>H
'
,
self
.
_tm_data
[
6
:
8
])[
0
]
time
_of_w
eek
=
struct
.
unpack
(
'
>I
'
,
self
.
_tm_data
[
8
:
12
])[
0
]
latitude
=
struct
.
unpack
(
'
>I
'
,
self
.
_tm_data
[
12
:
16
])[
0
]
longitude
=
struct
.
unpack
(
'
>I
'
,
self
.
_tm_data
[
16
:
20
])[
0
]
msa
=
struct
.
unpack
(
'
>I
'
,
self
.
_tm_data
[
20
:
24
])[
0
]
position
X
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
24
:
32
])[
0
]
position
Y
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
32
:
40
])[
0
]
position
Z
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
40
:
48
])[
0
]
position
_x
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
24
:
32
])[
0
]
position
_y
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
32
:
40
])[
0
]
position
_z
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
40
:
48
])[
0
]
vx
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
48
:
56
])[
0
]
vy
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
56
:
64
])[
0
]
vz
=
struct
.
unpack
(
'
>d
'
,
self
.
_tm_data
[
64
:
72
])[
0
]
self
.
hkContent
=
[
fix
M
ode
,
sv
InF
ix
,
gnss
W
eek
,
time
OfW
eek
,
latitude
,
longitude
,
msa
,
positionX
,
positionY
,
position
Z
,
vx
,
vy
,
vz
]
self
.
hkContent
=
[
fix
_m
ode
,
sv
_in_f
ix
,
gnss
_w
eek
,
time
_of_w
eek
,
latitude
,
longitude
,
msa
,
position
_x
,
position_y
,
position_z
,
vx
,
vy
,
vz
]
self
.
validity_buffer
=
self
.
_tm_data
[
72
:]
# print(self.validityBuffer)
# print(str(format(self.validityBuffer[0], '#010b')))
...
...
@@ -101,17 +113,29 @@ class Service3TM(PusTelemetry):
def
handle_test_hk_data
(
self
):
self
.
numberOfParameters
=
6
self
.
hkHeader
=
[
"
Bool
"
,
"
UINT8
"
,
"
UINT16
"
,
"
UINT32
"
,
"
FLOAT1
"
,
"
FLOAT2
"
]
test
B
ool
=
self
.
_tm_data
[
4
]
test
U
int8
=
self
.
_tm_data
[
5
]
test
U
int16
=
(
self
.
_tm_data
[
6
]
<<
8
)
|
self
.
_tm_data
[
7
]
test
U
int32
=
struct
.
unpack
(
'
>I
'
,
self
.
_tm_data
[
8
:
12
])[
0
]
float
V
ector1
=
struct
.
unpack
(
'
>f
'
,
self
.
_tm_data
[
12
:
16
])[
0
]
float
V
ector2
=
struct
.
unpack
(
'
>f
'
,
self
.
_tm_data
[
16
:
20
])[
0
]
self
.
hkContent
=
[
test
B
ool
,
test
U
int8
,
test
U
int16
,
test
U
int32
,
float
V
ector1
,
float
V
ector2
]
test
_b
ool
=
self
.
_tm_data
[
4
]
test
_u
int8
=
self
.
_tm_data
[
5
]
test
_u
int16
=
(
self
.
_tm_data
[
6
]
<<
8
)
|
self
.
_tm_data
[
7
]
test
_u
int32
=
struct
.
unpack
(
'
>I
'
,
self
.
_tm_data
[
8
:
12
])[
0
]
float
_v
ector1
=
struct
.
unpack
(
'
>f
'
,
self
.
_tm_data
[
12
:
16
])[
0
]
float
_v
ector2
=
struct
.
unpack
(
'
>f
'
,
self
.
_tm_data
[
16
:
20
])[
0
]
self
.
hkContent
=
[
test
_b
ool
,
test
_u
int8
,
test
_u
int16
,
test
_u
int32
,
float
_v
ector1
,
float
_v
ector2
]
self
.
validity_buffer
=
self
.
_tm_data
[
20
:]
# print(self.validityBuffer)
# print(str(format(self.validityBuffer[0], '#010b')))
# print("Validity Buffer Length: " + str(len(self.validityBuffer)))
def
handle_thermal_sensor_hk_data
(
self
):
self
.
numberOfParameters
=
2
self
.
hkHeader
=
[
"
Temperature
"
,
"
Error Byte
"
]
temperature_celcius
=
struct
.
unpack
(
'
!f
'
,
self
.
_tm_data
[
8
:
12
])[
0
]
error_byte
=
self
.
_tm_data
[
12
]
self
.
hkContent
=
[
temperature_celcius
,
error_byte
]
self
.
validity_buffer
=
self
.
_tm_data
[
13
:]
print
(
self
.
validity_buffer
)
def
handle_gyro_hk_data
(
self
):
pass
Service3TM
:
Type
[
PusTelemetry
]
This diff is collapsed.
Click to expand it.
tmtc_core
@
fc827894
Compare
66da7ab3
...
fc827894
Subproject commit
66da7ab3912f96494b6011f22738d1750149cd44
Subproject commit
fc827894676abd7fd464a15eea6d2aa510b7694b
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