Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emilio Corigliano
Skyward Boardcore
Commits
48446c79
Commit
48446c79
authored
2 years ago
by
Riccardo Musso
Browse files
Options
Downloads
Patches
Plain Diff
Implemented trivial entrypoint that transmits and receives mavlink nas_tm packets
parent
974b8309
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+3
-0
3 additions, 0 deletions
CMakeLists.txt
src/entrypoints/groundstation-nas-extractor.cpp
+76
-0
76 additions, 0 deletions
src/entrypoints/groundstation-nas-extractor.cpp
with
79 additions
and
0 deletions
CMakeLists.txt
+
3
−
0
View file @
48446c79
...
@@ -42,6 +42,9 @@ sbs_target(bmx160-calibration-v3 stm32f429zi_skyward_death_stack_v3)
...
@@ -42,6 +42,9 @@ sbs_target(bmx160-calibration-v3 stm32f429zi_skyward_death_stack_v3)
add_executable
(
config-dsgamma src/entrypoints/config-dsgamma.cpp
)
add_executable
(
config-dsgamma src/entrypoints/config-dsgamma.cpp
)
sbs_target
(
config-dsgamma stm32f429zi_stm32f4discovery
)
sbs_target
(
config-dsgamma stm32f429zi_stm32f4discovery
)
add_executable
(
groundstation-nas-extractor src/entrypoints/groundstation-nas-extractor.cpp
)
sbs_target
(
groundstation-nas-extractor stm32f407vg_stm32f4discovery
)
add_executable
(
imu-calibration src/entrypoints/imu-calibration.cpp
)
add_executable
(
imu-calibration src/entrypoints/imu-calibration.cpp
)
sbs_target
(
imu-calibration stm32f429zi_skyward_parafoil
)
sbs_target
(
imu-calibration stm32f429zi_skyward_parafoil
)
...
...
This diff is collapsed.
Click to expand it.
src/entrypoints/groundstation-nas-extractor.cpp
0 → 100644
+
76
−
0
View file @
48446c79
/* Copyright (c) 2023 Skyward Experimental Rocketry
* Author: Riccardo Musso
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include
<drivers/usart/USART.h>
#include
<mavlink_lib/pyxis/mavlink.h>
#include
<radio/MavlinkDriver/MavlinkDriver.h>
#include
<radio/SerialTransceiver/SerialTransceiver.h>
#include
<scheduler/TaskScheduler.h>
using
namespace
miosix
;
using
namespace
Boardcore
;
using
MavDriver
=
MavlinkDriver
<
20
,
10
>
;
void
sendMessage
();
void
receiveHandler
(
MavDriver
*
,
const
mavlink_message_t
&
);
USART
usart
(
USART1
,
USARTInterface
::
Baudrate
::
B115200
);
SerialTransceiver
transceiver
(
usart
);
MavDriver
mavlink
(
&
transceiver
,
receiveHandler
);
TaskScheduler
scheduler
;
int
main
()
{
u1rx1
::
mode
(
Mode
::
ALTERNATE
);
u1rx1
::
alternateFunction
(
7
);
u1tx1
::
mode
(
Mode
::
ALTERNATE
);
u1tx1
::
alternateFunction
(
7
);
usart
.
init
();
mavlink
.
start
();
scheduler
.
start
();
scheduler
.
addTask
(
sendMessage
,
2000
);
while
(
true
)
Thread
::
sleep
(
1000
);
}
void
sendMessage
()
{
mavlink_message_t
message
;
mavlink_msg_nas_tm_pack
(
1
,
1
,
&
message
,
TimestampTimer
::
getTimestamp
(),
0
,
0.75
,
2.54
,
120.5
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
mavlink
.
enqueueMsg
(
message
);
printf
(
"Sent message
\n
"
);
}
void
receiveHandler
(
MavDriver
*
channel
,
const
mavlink_message_t
&
msg
)
{
printf
(
"Received message (%llu) %f %f %f
\n
"
,
mavlink_msg_nas_tm_get_timestamp
(
&
msg
),
mavlink_msg_nas_tm_get_nas_n
(
&
msg
),
mavlink_msg_nas_tm_get_nas_e
(
&
msg
),
mavlink_msg_nas_tm_get_nas_d
(
&
msg
));
}
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