-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constructors with parameters in ROS2SensorComponents #433
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
efa6cce
pass config to ROS2CameraSensorEditorComponent
jhanca-robotecai dd8f91e
pass config to ROS2GNSSSensorComponent
jhanca-robotecai 0b20104
pass config to ROS2LidarSensorComponent and ROS2Lidar2DSensorComponent
jhanca-robotecai 68d1c2d
pass config to ROS2ImuSensorComponent
jhanca-robotecai 52d70aa
modify editor view: ShowChildrenOnly
jhanca-robotecai e6aafb9
update prefabs to new format
jhanca-robotecai 990f32c
EN_UK -> EN_US: visualise -> visualize
jhanca-robotecai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,47 @@ | ||
/* | ||
* Copyright (c) Contributors to the Open 3D Engine Project. | ||
* For complete copyright and license terms please see the LICENSE at the root of this distribution. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 OR MIT | ||
* | ||
*/ | ||
|
||
#include "GNSSSensorConfiguration.h" | ||
#include <AzCore/Serialization/EditContext.h> | ||
#include <AzCore/Serialization/EditContextConstants.inl> | ||
|
||
namespace ROS2 | ||
{ | ||
void GNSSSensorConfiguration::Reflect(AZ::ReflectContext* context) | ||
{ | ||
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context)) | ||
{ | ||
serialize->Class<GNSSSensorConfiguration>() | ||
->Version(1) | ||
->Field("originLatitude", &GNSSSensorConfiguration::m_originLatitudeDeg) | ||
->Field("originLongitude", &GNSSSensorConfiguration::m_originLongitudeDeg) | ||
->Field("originAltitude", &GNSSSensorConfiguration::m_originAltitude); | ||
|
||
if (AZ::EditContext* ec = serialize->GetEditContext()) | ||
{ | ||
ec->Class<GNSSSensorConfiguration>("ROS2 GNSS Sensor", "GNSS sensor component") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&GNSSSensorConfiguration::m_originLatitudeDeg, | ||
"Latitude offset", | ||
"GNSS latitude position offset in degrees") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&GNSSSensorConfiguration::m_originLongitudeDeg, | ||
"Longitude offset", | ||
"GNSS longitude position offset in degrees") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&GNSSSensorConfiguration::m_originAltitude, | ||
"Altitude offset", | ||
"GNSS altitude position offset in meters"); | ||
} | ||
} | ||
} | ||
|
||
} // namespace ROS2 |
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,26 @@ | ||
/* | ||
* Copyright (c) Contributors to the Open 3D Engine Project. | ||
* For complete copyright and license terms please see the LICENSE at the root of this distribution. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 OR MIT | ||
* | ||
*/ | ||
#pragma once | ||
|
||
#include <AzCore/RTTI/RTTI.h> | ||
#include <AzCore/Serialization/SerializeContext.h> | ||
#include <AzCore/std/string/string.h> | ||
|
||
namespace ROS2 | ||
{ | ||
//! A structure capturing configuration of a Global Navigation Satellite Systems (GNSS) sensor. | ||
struct GNSSSensorConfiguration | ||
{ | ||
AZ_TYPE_INFO(GNSSSensorConfiguration, "{8bc39c6b-2f2c-4612-bcc7-0cc7033001d4}"); | ||
static void Reflect(AZ::ReflectContext* context); | ||
|
||
float m_originLatitudeDeg = 0.0f; | ||
float m_originLongitudeDeg = 0.0f; | ||
float m_originAltitude = 0.0f; | ||
}; | ||
} // namespace ROS2 |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) Contributors to the Open 3D Engine Project. | ||
* For complete copyright and license terms please see the LICENSE at the root of this distribution. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 OR MIT | ||
* | ||
*/ | ||
|
||
#include "ImuSensorConfiguration.h" | ||
#include <AzCore/Serialization/EditContext.h> | ||
#include <AzCore/Serialization/EditContextConstants.inl> | ||
|
||
namespace ROS2 | ||
{ | ||
void ImuSensorConfiguration::Reflect(AZ::ReflectContext* context) | ||
{ | ||
if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context)) | ||
{ | ||
serialize->Class<ImuSensorConfiguration>() | ||
->Version(1) | ||
->Field("FilterSize", &ImuSensorConfiguration::m_filterSize) | ||
->Field("IncludeGravity", &ImuSensorConfiguration::m_includeGravity) | ||
->Field("AbsoluteRotation", &ImuSensorConfiguration::m_absoluteRotation) | ||
->Field("AccelerationVariance", &ImuSensorConfiguration::m_linearAccelerationVariance) | ||
->Field("AngularVelocityVariance", &ImuSensorConfiguration::m_angularVelocityVariance) | ||
->Field("OrientationVariance", &ImuSensorConfiguration::m_orientationVariance); | ||
|
||
if (AZ::EditContext* ec = serialize->GetEditContext()) | ||
{ | ||
ec->Class<ImuSensorConfiguration>("ROS2 IMU sensor configuration", "IMU sensor configuration") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Slider, | ||
&ImuSensorConfiguration::m_filterSize, | ||
"Filter Length", | ||
"Filter Length, Large value reduce numeric noise but increase lag") | ||
->Attribute(AZ::Edit::Attributes::Max, &ImuSensorConfiguration::m_maxFilterSize) | ||
->Attribute(AZ::Edit::Attributes::Min, &ImuSensorConfiguration::m_minFilterSize) | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ImuSensorConfiguration::m_includeGravity, | ||
"Include Gravitation", | ||
"Enable accelerometer to observe gravity force.") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ImuSensorConfiguration::m_absoluteRotation, | ||
"Absolute Rotation", | ||
"Include Absolute rotation in message.") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ImuSensorConfiguration::m_linearAccelerationVariance, | ||
"Linear Acceleration Variance", | ||
"Variance of linear acceleration.") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ImuSensorConfiguration::m_angularVelocityVariance, | ||
"Angular Velocity Variance", | ||
"Variance of angular velocity.") | ||
->DataElement( | ||
AZ::Edit::UIHandlers::Default, | ||
&ImuSensorConfiguration::m_orientationVariance, | ||
"Orientation Variance", | ||
"Variance of orientation."); | ||
} | ||
} | ||
} | ||
|
||
} // namespace ROS2 |
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,38 @@ | ||
/* | ||
* Copyright (c) Contributors to the Open 3D Engine Project. | ||
* For complete copyright and license terms please see the LICENSE at the root of this distribution. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 OR MIT | ||
* | ||
*/ | ||
#pragma once | ||
|
||
#include <AzCore/Math/Matrix3x3.h> | ||
#include <AzCore/RTTI/RTTI.h> | ||
#include <AzCore/Serialization/SerializeContext.h> | ||
#include <AzCore/std/string/string.h> | ||
|
||
namespace ROS2 | ||
{ | ||
//! A structure capturing configuration of a IMU sensor. | ||
struct ImuSensorConfiguration | ||
{ | ||
AZ_TYPE_INFO(ImuSensorConfiguration, "{6788e84f-b985-4413-8e2b-46fbfb667c95}"); | ||
static void Reflect(AZ::ReflectContext* context); | ||
|
||
//! Length of filter that removes numerical noise | ||
int m_filterSize = 10; | ||
int m_minFilterSize = 1; | ||
int m_maxFilterSize = 200; | ||
|
||
//! Include gravity acceleration | ||
bool m_includeGravity = true; | ||
|
||
//! Measure also absolute rotation | ||
bool m_absoluteRotation = true; | ||
|
||
AZ::Vector3 m_orientationVariance = AZ::Vector3::CreateZero(); | ||
AZ::Vector3 m_angularVelocityVariance = AZ::Vector3::CreateZero(); | ||
AZ::Vector3 m_linearAccelerationVariance = AZ::Vector3::CreateZero(); | ||
}; | ||
} // namespace ROS2 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like that change. There are designs, projects, and Gems that use that component and this changes reflection.