-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e62079
commit 937de75
Showing
6 changed files
with
51 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sonar.sources=Cyphal,Udral,ds015,examples | ||
sonar.sources=Cyphal,Udral,ds015,zubax,examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
sonar.projectKey=RaccoonlabDev_cyphal_application | ||
sonar.organization=raccoonlabdev | ||
sonar.sources=Cyphal,Udral,ds015,examples | ||
sonar.sources=Cyphal,Udral,ds015,zubax,examples | ||
sonar.cfamily.build-wrapper-output=bw-output | ||
sonar.host.url=https://sonarcloud.io | ||
sonar.cfamily.gcov.reportsPath=build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/// This software is distributed under the terms of the MIT License. | ||
/// Copyright (c) 2024 Dmitry Ponomarev. | ||
/// Author: Dmitry Ponomarev <[email protected]> | ||
|
||
#include "compact_feedback.hpp" | ||
#include "main.h" | ||
#include "params.hpp" | ||
|
||
namespace zubax::telega { | ||
|
||
void CompactFeedbackPublisher::publish(const CompactFeedback& msg) { | ||
push(zubax_telega_CompactFeedback_0_1_SERIALIZATION_BUFFER_SIZE_BYTES, (const uint8_t*)&msg); | ||
} | ||
|
||
} // namespace zubax::telega |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/// This software is distributed under the terms of the MIT License. | ||
/// Copyright (c) 2023 Dmitry Ponomarev. | ||
/// Author: Dmitry Ponomarev <[email protected]> | ||
|
||
#ifndef ZUBAX_COMPACT_FEEDBACK_HPP_ | ||
#define ZUBAX_COMPACT_FEEDBACK_HPP_ | ||
|
||
#include "cyphal.hpp" | ||
#include "cyphal_publishers.hpp" | ||
|
||
namespace zubax::telega { | ||
|
||
// https://telega.zubax.com/interfaces/cyphal.html#compact | ||
#pragma pack(push, 1) | ||
struct CompactFeedback { | ||
uint32_t dc_voltage : 11; | ||
int32_t dc_current : 12; | ||
int32_t phase_current_amplitude : 12; | ||
int32_t velocity : 13; | ||
int8_t demand_factor_pct : 8; | ||
}; | ||
#pragma pack(pop) | ||
|
||
struct CompactFeedbackPublisher: public cyphal::CyphalPublisher { | ||
CompactFeedbackPublisher() : cyphal::CyphalPublisher(cyphal::Cyphal::get_instance(), 65535) { } | ||
void publish(const CompactFeedback& msg); | ||
static constexpr float RPM_TO_RAD_PER_SEC = 0.1047198; | ||
private: | ||
static constexpr size_t zubax_telega_CompactFeedback_0_1_SERIALIZATION_BUFFER_SIZE_BYTES = 7; | ||
}; | ||
|
||
} // namespace zubax::telega | ||
|
||
#endif // ZUBAX_COMPACT_FEEDBACK_HPP_ |