Skip to content
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

Cherry-picks development -> stabilization #745

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
944a752
Fix issue with position control index processing (#697)
nbbrooks May 20, 2024
4c54af8
Update ROS2 Related prefabs (#695)
MateuszWasilewski May 29, 2024
3406f24
Update repo.json to reflect changes to the ros2roboticmanipulationtem…
spham-amzn May 30, 2024
8720012
Update gem.json files of ROS2 related Gems (#703)
jhanca-robotecai Jun 12, 2024
2ce5db8
Added option to spawn entities with WGS84 coords using existing ros s…
patrykantosz Jun 17, 2024
dc4743c
Fix ROS 2 System component to work with Simulate in Editor (#708)
michalpelka Jun 18, 2024
beb2411
Fix spell error in georeference bus in ROS2 (#712)
michalpelka Jun 20, 2024
1098fcb
Modified clock design, added new time source (#707)
patrykantosz Jun 20, 2024
7434e3f
Update ROS 2 sensors base implemtation (#715)
michalpelka Jun 25, 2024
c6d1dae
Lidar acquires data when publishing disabled (#724)
c00kiepreferences Jul 8, 2024
149d2f9
Lidar raycast data changed to quaternions (#720)
c00kiepreferences Jul 8, 2024
dcda6e4
Added support to do MSAA Resolve (#733)
galibzon Jul 17, 2024
e57f3e3
Use simulation time to compute time difference. (#714)
michalpelka Jul 22, 2024
04f1d3d
Extend description of frames in o3de (#726)
c00kiepreferences Jul 9, 2024
a9f15ab
TopicConfiguration: added QoS constructor (#738)
c00kiepreferences Jul 30, 2024
a3b80e6
[ROS2] Remove deprecated documentation (#731)
Fireronin Jul 30, 2024
086ad6f
Fixes for templates (#723)
jhanca-robotecai Aug 2, 2024
6673693
RobotImporter features: topic names, namespaces, handling plugins, jo…
c00kiepreferences Aug 12, 2024
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
7 changes: 6 additions & 1 deletion Gems/OpenXRVk/Code/Source/OpenXRVkSwapChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ namespace OpenXRVk
swapchainCreateInfo.mipCount = m_mipCount;
swapchainCreateInfo.faceCount = m_faceCount;
swapchainCreateInfo.sampleCount = m_sampleCount;
swapchainCreateInfo.usageFlags = XR_SWAPCHAIN_USAGE_SAMPLED_BIT | XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT;
swapchainCreateInfo.usageFlags = XR_SWAPCHAIN_USAGE_SAMPLED_BIT |
XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT |
XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT |
XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT |
XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_KHR
;

XrSwapchain handle = XR_NULL_HANDLE;
result = xrCreateSwapchain(xrSession, &swapchainCreateInfo, &handle);
Expand Down
14 changes: 7 additions & 7 deletions Gems/ProteusRobot/Assets/Proteus.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
"guid": "{8A2E7A82-D7C3-5E9C-A56C-6EDA70876347}",
"subId": 268721130
},
"assetHint": "materialeditor/viewportmodels/cylinder.azmodel"
"assetHint": "materialeditor/viewportmodels/cylinder.fbx.azmodel"
}
}
}
Expand Down Expand Up @@ -728,12 +728,12 @@
},
"Component_[639102350977932618]": {
"$type": "ROS2FrameEditorComponent",
"Id": 1381491360893018223,
"ROS2FrameConfiguration": {
"Namespace Configuration": {
"Namespace": "base_link"
},
"Frame Name": "base_link",
"Effective namespace": "base_link"
"Frame Name": "base_link"
}
},
"Component_[6563269519356188309]": {
Expand Down Expand Up @@ -1400,7 +1400,7 @@
"guid": "{42648578-F5A3-52BC-89BF-0D5FC8608250}",
"subId": 276024436
},
"assetHint": "proteus2_lift.azmodel"
"assetHint": "proteus2_lift.fbx.azmodel"
}
}
}
Expand Down Expand Up @@ -1759,7 +1759,7 @@
"guid": "{F9B95287-0FA8-5624-92A1-217B33F08280}",
"subId": 277942675
},
"assetHint": "proteus_wheel.azmodel"
"assetHint": "proteus_wheel.fbx.azmodel"
}
}
}
Expand Down Expand Up @@ -1875,7 +1875,7 @@
"guid": "{F9B95287-0FA8-5624-92A1-217B33F08280}",
"subId": 277942675
},
"assetHint": "proteus_wheel.azmodel"
"assetHint": "proteus_wheel.fbx.azmodel"
}
}
}
Expand Down Expand Up @@ -2036,7 +2036,7 @@
"guid": "{60318C54-1D60-53EC-85AA-2CADBFD83ED9}",
"subId": 278773777
},
"assetHint": "proteus2_chassis.azmodel"
"assetHint": "proteus2_chassis.fbx.azmodel"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Gems/ProteusRobot/gem.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@
"restricted": "ProteusRobot",
"download_source_uri": "https://github.com/o3de/o3de-extras/releases/download/2.0/proteusrobot-2.0.0-gem.zip"
}

6 changes: 3 additions & 3 deletions Gems/ROS2/Assets/Prefabs/Sensors/CameraOrbbeck.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"MaterialSlots": {
"Slots": [
{
"Name": "Entire object"
"Name": "DefaultMaterial"
}
]
}
Expand All @@ -89,7 +89,7 @@
"guid": "{0E27CF27-5752-5557-B77A-4B29A5870E0E}",
"subId": 3865077323
},
"assetHint": "models/sensors/camera/cameraorbbeck.pxmesh"
"assetHint": "models/sensors/camera/cameraorbbeck.fbx.pxmesh"
},
"Configuration": {
"PhysicsAsset": {
Expand All @@ -98,7 +98,7 @@
"subId": 3865077323
},
"loadBehavior": "QueueLoad",
"assetHint": "models/sensors/camera/cameraorbbeck.pxmesh"
"assetHint": "models/sensors/camera/cameraorbbeck.fbx.pxmesh"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Gems/ROS2/Assets/Prefabs/Sensors/LidarOS2.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"guid": "{99D850A3-8E59-5E78-93FE-AE8DB228684D}",
"subId": 2574200790
},
"assetHint": "models/sensors/lidaros2/lidaros2.pxmesh"
"assetHint": "models/sensors/lidaros2/lidaros2.fbx.pxmesh"
},
"Configuration": {
"PhysicsAsset": {
Expand All @@ -183,7 +183,7 @@
"subId": 2574200790
},
"loadBehavior": "QueueLoad",
"assetHint": "models/sensors/lidaros2/lidaros2.pxmesh"
"assetHint": "models/sensors/lidaros2/lidaros2.fbx.pxmesh"
}
}
}
Expand Down
26 changes: 26 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/ITimeSource.h
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 <builtin_interfaces/msg/time.hpp>

namespace ROS2
{
class ITimeSource
{
public:
virtual void Activate() = 0;
virtual void Deactivate() = 0;

virtual ~ITimeSource() = default;

//! Get time as ROS 2 message.
//! @see ROS2Requests::GetROSTimestamp() for more details.
virtual builtin_interfaces::msg::Time GetROSTimestamp() const = 0;
};
} // namespace ROS2
38 changes: 0 additions & 38 deletions Gems/ROS2/Code/Include/ROS2/Clock/PhysicallyStableClock.h

This file was deleted.

45 changes: 45 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/ROS2Clock.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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 "ITimeSource.h"
#include <AzCore/std/chrono/chrono.h>
#include <AzCore/std/smart_ptr/unique_ptr.h>
#include <rclcpp/publisher.hpp>
#include <rosgraph_msgs/msg/clock.hpp>

namespace ROS2
{
//! The ROS2Clock provides ROS timestamps as builtin_interface::msg::Time messages.
//! The clock can use different types of the time sources and publish the current
//! time to the ROS 2 `/clock/` topic. The published time can be used with
//! the /use_sim_time parameter set to true.
class ROS2Clock
{
static constexpr size_t FramesNumberForStats = 60;

public:
ROS2Clock();
ROS2Clock(AZStd::unique_ptr<ITimeSource> timeSource, bool publishClock);
~ROS2Clock() = default;

void Activate();
void Deactivate();

builtin_interfaces::msg::Time GetROSTimestamp() const;

//! Update time in the ROS 2 ecosystem.
//! This will publish current time to the ROS 2 `/clock` topic, if Clock is configured to do it.
void Tick();

private:
rclcpp::Publisher<rosgraph_msgs::msg::Clock>::SharedPtr m_clockPublisher;
AZStd::unique_ptr<ITimeSource> m_timeSource;
bool m_publishClock;
};
} // namespace ROS2
30 changes: 30 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/ROS2TimeSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* 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 "ITimeSource.h"

namespace ROS2
{
//! The ROS2TimeSource provides the time taken from the ROS 2. By default
//! this is system_time but it can be configured to provide the time from the other sources.
class ROS2TimeSource : public ITimeSource
{
public:
virtual ~ROS2TimeSource() = default;

// ITimeSource overrides ...
virtual void Activate() override {};
virtual void Deactivate() override {};

//! Get ROS 2 time as ROS2 message.
//! @see ROS2Requests::GetROSTimestamp() for more details.
virtual builtin_interfaces::msg::Time GetROSTimestamp() const override;
};

} // namespace ROS2
36 changes: 36 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/RealTimeSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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 "ITimeSource.h"

namespace ROS2
{
//! The RealTimeSource starts from 0 at the start of the simulation.
//! This time source could be affected by the jitter in the data, simulation
//! computations or other similar events. On the other hand RealTimeSource
//! can remain consistent with the other independent clocks if it is synchronised
//! (e.g. through NTP).
class RealTimeSource : public ITimeSource
{
public:
virtual ~RealTimeSource() = default;

// ITimeSource overrides ...
virtual void Activate() override {};
virtual void Deactivate() override {};

//! Get simulation time as ROS 2 message.
//! @see ROS2Requests::GetROSTimestamp() for more details.
virtual builtin_interfaces::msg::Time GetROSTimestamp() const override;

private:
//! Get the time since start of sim, scaled with t_simulationTickScale
int64_t GetElapsedTimeMicroseconds() const;
};
} // namespace ROS2
49 changes: 0 additions & 49 deletions Gems/ROS2/Code/Include/ROS2/Clock/SimulationClock.h

This file was deleted.

43 changes: 43 additions & 0 deletions Gems/ROS2/Code/Include/ROS2/Clock/SimulationTimeSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 "ITimeSource.h"
#include <AzFramework/Physics/Common/PhysicsEvents.h>
#include <AzFramework/Physics/PhysicsSystem.h>

namespace ROS2
{
//! The SimulationTimeSource provides timestamps calculated using updates from the physics engine.
//! Simulation paces the clock with stable steps, and as a result, this time source eliminates data jitter.
//! The simulated time can be faster or slower than the real-time, according to the configuration of the physics engine.
//! SimulationTimeSource is used as the default time source for the projects.
//! The simulated clock is incremented with delta times that were simulated by physics.
//! The time source registers and observes AZ::PhysicsScene and when the
//! simulation starts, it attaches and starts counting the updates.
//! It is recommended to use it with high-frequency sensors such as odometry and IMUs.
class SimulationTimeSource : public ITimeSource
{
public:
virtual ~SimulationTimeSource() = default;

// ITimeSource overrides ...
virtual void Activate() override;
virtual void Deactivate() override;

//! Get ROS 2 time as ROS2 message.
//! @see ROS2Requests::GetROSTimestamp() for more details.
virtual builtin_interfaces::msg::Time GetROSTimestamp() const override;

private:
double m_elapsed = 0;
AzPhysics::SceneEvents::OnSceneSimulationFinishHandler m_onSceneSimulationEvent;
AzPhysics::SystemEvents::OnSceneAddedEvent::Handler m_onSceneAdded;
AzPhysics::SystemEvents::OnSceneRemovedEvent::Handler m_onSceneRemoved;
};
} // namespace ROS2
Loading