Skip to content

Commit b91ff1d

Browse files
committed
Added Physx stuff
Signed-off-by: Michał Pełka <[email protected]>
1 parent cfe25f2 commit b91ff1d

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

Gems/SensorDebug/Code/Source/Clients/SensorDebugSystemComponent.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,11 @@ namespace SensorDebug
186186
ImGui::Begin("ROS2 SensorDebugger");
187187
ImGui::Separator();
188188
ImGui::Text("TimeyWimey Stuff");
189-
190-
auto ros2ts = ROS2::ROS2Interface::Get()->GetROSTimestamp();
189+
const auto ros2Intreface = ROS2::ROS2Interface::Get();
190+
auto ros2ts = ros2Intreface ? ROS2::ROS2Interface::Get()->GetROSTimestamp() : builtin_interfaces::msg::Time();
191191
const float ros2tsSec = ros2ts.sec + ros2ts.nanosec / 1e9;
192-
auto ros2Node = ROS2::ROS2Interface::Get()->GetNode();
193-
194-
auto nodeTime = ros2Node->now();
192+
auto ros2Node = ros2Intreface ? ROS2::ROS2Interface::Get()->GetNode() : nullptr;
193+
auto nodeTime = ros2Node ? ros2Node->now() : rclcpp::Time(0, 0);
195194
const float ros2nodetsSec = nodeTime.seconds() + nodeTime.nanoseconds() / 1e9;
196195

197196
auto timeSystem = AZ::Interface<AZ::ITime>::Get();
@@ -204,7 +203,7 @@ namespace SensorDebug
204203
ImGui::Separator();
205204
ImGui::Text("PhysX");
206205
ImGui::InputFloat("Fixed timestamp", &ModifiedPhysXConfig.m_fixedTimestep, 0.0f, 0.0f, "%.6f");
207-
ImGui::InputFloat("Max timestamp", &ModifiedPhysXConfig.m_maxTimestep, 0.0f, 0.0f, "%.6f"git a);
206+
ImGui::InputFloat("Max timestamp", &ModifiedPhysXConfig.m_maxTimestep, 0.0f, 0.0f, "%.6f");
208207
if (ImGui::Button("Update PhysX Config"))
209208
{
210209
UpdatePhysXConfig();

Gems/SensorDebug/Code/Source/Clients/SensorDebugSystemComponent.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ namespace SensorDebug
6262
AZStd::vector<float> m_appFrequencies;
6363
float m_maxFPS = 60.0f;
6464
int m_historySize = 1000;
65-
66-
67-
68-
6965
AzPhysics::Scene* m_scene = nullptr;
7066
};
7167
} // namespace SensorDebug

Gems/SensorDebug/Code/Source/Tools/SensorDebugEditorSystemComponent.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,25 @@ namespace SensorDebug
1919

2020
void SensorDebugEditorSystemComponent::Activate()
2121
{
22-
SensorDebugSystemComponent::Activate();
22+
2323
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
2424
}
2525

2626
void SensorDebugEditorSystemComponent::Deactivate()
2727
{
2828
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
29-
SensorDebugSystemComponent::Deactivate();
29+
3030
}
3131

3232
void SensorDebugEditorSystemComponent::OnStartPlayInEditorBegin()
3333
{
3434
ClearSensors();
35+
SensorDebugSystemComponent::Activate();
3536
}
3637

3738
void SensorDebugEditorSystemComponent::OnStopPlayInEditor()
3839
{
3940
ClearSensors();
41+
SensorDebugSystemComponent::Deactivate();
4042
}
4143
} // namespace SensorDebug

0 commit comments

Comments
 (0)