Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions app/backplane/sensor_module/.idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/backplane/sensor_module/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions include/f_core/math/n_math_utils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef N_MATH_UTILS_H
#define N_MATH_UTILS_H

#include <zsl/orientation/quaternions.h>

namespace NMathUtils {
/**
* @brief Calculate roll, pitch, and yaw from a quaternion.
*
* @param[in] inputQuat The input quaternion.
* @param[out] roll Output roll angle in radians.
Copy link
Contributor

Choose a reason for hiding this comment

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

either this comment is wrong or the implementation is wrong? You have a multiplier of 180/pi which turns radians into degrees in the implementation but say it comes out as radians?

* @param[out] pitch Output pitch angle in radians.
* @param[out] yaw Output yaw angle in radians.
*/
void CalculateRollPitchYaw(zsl_quat inputQuat, float& roll, float& pitch, float& yaw);
};

#endif //N_MATH_UTILS_H
5 changes: 3 additions & 2 deletions lib/f_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ zephyr_library()

add_subdirectory_ifdef(CONFIG_F_CORE_DEVICE device)
add_subdirectory_ifdef(CONFIG_F_CORE_SENSOR device/sensor)
add_subdirectory_ifdef(CONFIG_F_CORE_MATH math)
add_subdirectory_ifdef(CONFIG_F_CORE_NET net)
add_subdirectory_ifdef(CONFIG_F_CORE_RADIO radio)
add_subdirectory_ifdef(CONFIG_F_CORE_OS os)
add_subdirectory_ifdef(CONFIG_F_CORE_UTILS utils)
add_subdirectory_ifdef(CONFIG_F_CORE_PROTOCOLS radio/protocols)
add_subdirectory_ifdef(CONFIG_F_CORE_RADIO radio)
add_subdirectory_ifdef(CONFIG_F_CORE_STATE_MACHINE state_machine)
add_subdirectory_ifdef(CONFIG_F_CORE_UTILS utils)
6 changes: 6 additions & 0 deletions lib/f_core/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ config F_CORE_SENSOR
help
This option enables sensor functionality for F-Core

config F_CORE_MATH
bool "Math"
help
This option enables math functionality for F-Core
select ZSL

config F_CORE_NET
bool "Network"
help
Expand Down
7 changes: 7 additions & 0 deletions lib/f_core/math/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2025 RIT Launch Initiative
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
FILE(GLOB sources *.cpp)
zephyr_library_sources(${sources})

14 changes: 14 additions & 0 deletions lib/f_core/math/n_math_utils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "f_core/math/n_math_utils.h"


void NMathUtils::CalculateRollPitchYaw(zsl_quat inputQuat, float& roll, float& pitch, float& yaw)
{
static constexpr multiplier = 180 / ZSL_PI;
Copy link

Copilot AI Jun 28, 2025

Choose a reason for hiding this comment

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

Missing type for the constant 'multiplier'. Consider specifying a type (e.g., 'float') or using 'auto' to ensure proper type deduction.

Suggested change
static constexpr multiplier = 180 / ZSL_PI;
static constexpr double multiplier = 180 / ZSL_PI;

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

robots kinda cooking with this one

zsl_euler euler;

zsl_quat_to_euler(&inputQuat, &euler);

roll = euler.x * multiplier;
pitch = euler.y * multiplier;
yaw = euler.z * multiplier;
}
7 changes: 4 additions & 3 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ manifest:
- hal_nxp
- littlefs
- loramac-node
- hal_st
Copy link
Member Author

Choose a reason for hiding this comment

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

Note github diff doesn't show that it's present above. This is just deleting a duplicate entry

- lz4
- segger
- percepio
- lz4
clone-depth: 1

- name: zscilib
remote: zephyrproject-rtos
revision: master
Loading