-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Constructors with parameters in ROS2SensorComponents (#433)
* pass config to ROS2CameraSensorEditorComponent * pass config to ROS2GNSSSensorComponent * pass config to ROS2LidarSensorComponent and ROS2Lidar2DSensorComponent * pass config to ROS2ImuSensorComponent * modify editor view: ShowChildrenOnly * update prefabs to new format * EN_UK -> EN_US: visualise -> visualize --------- Signed-off-by: Jan Hanca <[email protected]>
- Loading branch information
1 parent
3d40c2d
commit 76e6569
Showing
28 changed files
with
814 additions
and
480 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
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.