-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from RobotecAI/mw/formatting
Add clang-format CI to repo
- Loading branch information
Showing
47 changed files
with
280 additions
and
273 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
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 @@ | ||
name: clang-format check | ||
on: [pull_request] | ||
|
||
jobs: | ||
formatting-check: | ||
name: Formatting Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run clang-format style check. | ||
uses: jidicula/[email protected] | ||
with: | ||
clang-format-version: "15" | ||
check-path: "Gems" | ||
exclude-regex: "3rdParty" # Exclude paths containing "3rdParty" |
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
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 |
---|---|---|
|
@@ -49,7 +49,6 @@ namespace Pointcloud | |
{ | ||
} | ||
|
||
|
||
void PointcloudSystemComponent::Init() | ||
{ | ||
} | ||
|
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
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
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
129 changes: 69 additions & 60 deletions
129
Gems/ROS2PoseControl/Code/Source/Clients/ROS2PoseControlConfiguration.cpp
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,74 +1,83 @@ | ||
#include <AzCore/Serialization/EditContext.h> | ||
#include <ROS2PoseControl/ROS2PoseControlConfiguration.h> | ||
|
||
namespace ROS2PoseControl { | ||
AZ::Crc32 ROS2PoseControlConfiguration::isTrackingModeTF2Visibility() const { | ||
return m_tracking_mode == TrackingMode::TF2 | ||
? AZ::Edit::PropertyVisibility::Show | ||
: AZ::Edit::PropertyVisibility::Hide; | ||
namespace ROS2PoseControl | ||
{ | ||
AZ::Crc32 ROS2PoseControlConfiguration::isTrackingModeTF2Visibility() const | ||
{ | ||
return m_tracking_mode == TrackingMode::TF2 ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide; | ||
} | ||
|
||
AZ::Crc32 ROS2PoseControlConfiguration::isTrackingModePoseMessagesVisibility() const { | ||
return m_tracking_mode == TrackingMode::PoseMessages | ||
? AZ::Edit::PropertyVisibility::Show | ||
: AZ::Edit::PropertyVisibility::Hide; | ||
AZ::Crc32 ROS2PoseControlConfiguration::isTrackingModePoseMessagesVisibility() const | ||
{ | ||
return m_tracking_mode == TrackingMode::PoseMessages ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide; | ||
} | ||
|
||
AZ::Crc32 ROS2PoseControlConfiguration::isGroudOffsetVisible() const { | ||
return m_clampToGround ? AZ::Edit::PropertyVisibility::Show | ||
: AZ::Edit::PropertyVisibility::Hide; | ||
AZ::Crc32 ROS2PoseControlConfiguration::isGroudOffsetVisible() const | ||
{ | ||
return m_clampToGround ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide; | ||
} | ||
|
||
void ROS2PoseControlConfiguration::Reflect(AZ::ReflectContext *context) { | ||
if (auto serializeContext = azrtti_cast<AZ::SerializeContext *>(context)) { | ||
void ROS2PoseControlConfiguration::Reflect(AZ::ReflectContext* context) | ||
{ | ||
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context)) | ||
{ | ||
serializeContext->Class<ROS2PoseControlConfiguration>() | ||
->Version(1) | ||
->Field("m_tracking_mode", &ROS2PoseControlConfiguration::m_tracking_mode) | ||
->Field("m_poseTopicConfiguration", &ROS2PoseControlConfiguration::m_poseTopicConfiguration) | ||
->Field("m_targetFrame", &ROS2PoseControlConfiguration::m_targetFrame) | ||
->Field("m_referenceFrame", &ROS2PoseControlConfiguration::m_referenceFrame) | ||
->Field("lockZAxis", &ROS2PoseControlConfiguration::m_lockZAxis) | ||
->Field("startOffsetTag", &ROS2PoseControlConfiguration::m_startOffsetTag) | ||
->Field("m_clampToGround", &ROS2PoseControlConfiguration::m_clampToGround) | ||
->Field("m_groundOffset", &ROS2PoseControlConfiguration::m_groundOffset); | ||
->Version(1) | ||
->Field("m_tracking_mode", &ROS2PoseControlConfiguration::m_tracking_mode) | ||
->Field("m_poseTopicConfiguration", &ROS2PoseControlConfiguration::m_poseTopicConfiguration) | ||
->Field("m_targetFrame", &ROS2PoseControlConfiguration::m_targetFrame) | ||
->Field("m_referenceFrame", &ROS2PoseControlConfiguration::m_referenceFrame) | ||
->Field("lockZAxis", &ROS2PoseControlConfiguration::m_lockZAxis) | ||
->Field("startOffsetTag", &ROS2PoseControlConfiguration::m_startOffsetTag) | ||
->Field("m_clampToGround", &ROS2PoseControlConfiguration::m_clampToGround) | ||
->Field("m_groundOffset", &ROS2PoseControlConfiguration::m_groundOffset); | ||
|
||
if (AZ::EditContext *ec = serializeContext->GetEditContext()) { | ||
ec->Class<ROS2PoseControlConfiguration>("ROS2PoseControlConfiguration", | ||
"Sub configuration for ROS2PoseControl component") | ||
->ClassElement(AZ::Edit::ClassElements::EditorData, "") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::ComboBox, | ||
&ROS2PoseControlConfiguration::m_tracking_mode, | ||
"Tracking Mode", | ||
"Selects tracking mode") | ||
->EnumAttribute(TrackingMode::PoseMessages, "Pose Messages") | ||
->EnumAttribute(TrackingMode::TF2, "TF2") | ||
->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ROS2PoseControlConfiguration::m_poseTopicConfiguration, | ||
"Topic for control message", | ||
"Configuration for ROS2 topic to receive control messages to") | ||
->Attribute(AZ::Edit::Attributes::Visibility, | ||
&ROS2PoseControlConfiguration::isTrackingModePoseMessagesVisibility) | ||
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2PoseControlConfiguration::m_targetFrame, | ||
"Target Frame", "Frame to track eg. base_link") | ||
->Attribute(AZ::Edit::Attributes::Visibility, | ||
&ROS2PoseControlConfiguration::isTrackingModeTF2Visibility) | ||
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2PoseControlConfiguration::m_referenceFrame, | ||
"Reference Frame", "Reference frame eg. map") | ||
->Attribute(AZ::Edit::Attributes::Visibility, | ||
&ROS2PoseControlConfiguration::isTrackingModeTF2Visibility) | ||
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2PoseControlConfiguration::m_lockZAxis, | ||
"Lock Z Axis", "Lock Z axis") | ||
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2PoseControlConfiguration::m_startOffsetTag, | ||
"Start Offset Tag", "Tag that will be used to set the start offset for the entity.") | ||
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2PoseControlConfiguration::m_clampToGround, | ||
"Clamp to Ground", "Clamp to ground") | ||
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2PoseControlConfiguration::m_groundOffset, "Ground Offset", | ||
"Offset from the ground") | ||
->Attribute(AZ::Edit::Attributes::Visibility, &ROS2PoseControlConfiguration::isGroudOffsetVisible); | ||
if (AZ::EditContext* ec = serializeContext->GetEditContext()) | ||
{ | ||
ec->Class<ROS2PoseControlConfiguration>("ROS2PoseControlConfiguration", "Sub configuration for ROS2PoseControl component") | ||
->ClassElement(AZ::Edit::ClassElements::EditorData, "") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::ComboBox, | ||
&ROS2PoseControlConfiguration::m_tracking_mode, | ||
"Tracking Mode", | ||
"Selects tracking mode") | ||
->EnumAttribute(TrackingMode::PoseMessages, "Pose Messages") | ||
->EnumAttribute(TrackingMode::TF2, "TF2") | ||
->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ROS2PoseControlConfiguration::m_poseTopicConfiguration, | ||
"Topic for control message", | ||
"Configuration for ROS2 topic to receive control messages to") | ||
->Attribute(AZ::Edit::Attributes::Visibility, &ROS2PoseControlConfiguration::isTrackingModePoseMessagesVisibility) | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ROS2PoseControlConfiguration::m_targetFrame, | ||
"Target Frame", | ||
"Frame to track eg. base_link") | ||
->Attribute(AZ::Edit::Attributes::Visibility, &ROS2PoseControlConfiguration::isTrackingModeTF2Visibility) | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ROS2PoseControlConfiguration::m_referenceFrame, | ||
"Reference Frame", | ||
"Reference frame eg. map") | ||
->Attribute(AZ::Edit::Attributes::Visibility, &ROS2PoseControlConfiguration::isTrackingModeTF2Visibility) | ||
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2PoseControlConfiguration::m_lockZAxis, "Lock Z Axis", "Lock Z axis") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ROS2PoseControlConfiguration::m_startOffsetTag, | ||
"Start Offset Tag", | ||
"Tag that will be used to set the start offset for the entity.") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, &ROS2PoseControlConfiguration::m_clampToGround, "Clamp to Ground", "Clamp to ground") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ROS2PoseControlConfiguration::m_groundOffset, | ||
"Ground Offset", | ||
"Offset from the ground") | ||
->Attribute(AZ::Edit::Attributes::Visibility, &ROS2PoseControlConfiguration::isGroudOffsetVisible); | ||
} | ||
} | ||
}; | ||
} // namespace ROS2 | ||
} // namespace ROS2PoseControl |
7 changes: 3 additions & 4 deletions
7
Gems/ROS2PoseControl/Code/Source/Clients/ROS2PoseControlModule.cpp
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,17 +1,16 @@ | ||
|
||
#include "ROS2PoseControlSystemComponent.h" | ||
#include <ROS2PoseControl/ROS2PoseControlTypeIds.h> | ||
#include <ROS2PoseControlModuleInterface.h> | ||
#include "ROS2PoseControlSystemComponent.h" | ||
|
||
namespace ROS2PoseControl | ||
{ | ||
class ROS2PoseControlModule | ||
: public ROS2PoseControlModuleInterface | ||
class ROS2PoseControlModule : public ROS2PoseControlModuleInterface | ||
{ | ||
public: | ||
AZ_RTTI(ROS2PoseControlModule, ROS2PoseControlModuleTypeId, ROS2PoseControlModuleInterface); | ||
AZ_CLASS_ALLOCATOR(ROS2PoseControlModule, AZ::SystemAllocator); | ||
}; | ||
}// namespace ROS2PoseControl | ||
} // namespace ROS2PoseControl | ||
|
||
AZ_DECLARE_MODULE_CLASS(Gem_ROS2PoseControl, ROS2PoseControl::ROS2PoseControlModule) |
Oops, something went wrong.