Skip to content

Commit

Permalink
Added Physx stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Pełka <[email protected]>
  • Loading branch information
michalpelka committed Dec 5, 2024
1 parent cfe25f2 commit e2eb4bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,11 @@ namespace SensorDebug
ImGui::Begin("ROS2 SensorDebugger");
ImGui::Separator();
ImGui::Text("TimeyWimey Stuff");

auto ros2ts = ROS2::ROS2Interface::Get()->GetROSTimestamp();
const auto ros2Intreface = ROS2::ROS2Interface::Get();
auto ros2ts = ros2Intreface ? ROS2::ROS2Interface::Get()->GetROSTimestamp() : builtin_interfaces::msg::Time();
const float ros2tsSec = ros2ts.sec + ros2ts.nanosec / 1e9;
auto ros2Node = ROS2::ROS2Interface::Get()->GetNode();

auto nodeTime = ros2Node->now();
auto ros2Node = ros2Intreface? ROS2::ROS2Interface::Get()->GetNode() : nullptr;
auto nodeTime = ros2Node? ros2Node->now() : rclcpp::Time(0,0);
const float ros2nodetsSec = nodeTime.seconds() + nodeTime.nanoseconds() / 1e9;

auto timeSystem = AZ::Interface<AZ::ITime>::Get();
Expand All @@ -204,7 +203,7 @@ namespace SensorDebug
ImGui::Separator();
ImGui::Text("PhysX");
ImGui::InputFloat("Fixed timestamp", &ModifiedPhysXConfig.m_fixedTimestep, 0.0f, 0.0f, "%.6f");
ImGui::InputFloat("Max timestamp", &ModifiedPhysXConfig.m_maxTimestep, 0.0f, 0.0f, "%.6f"git a);
ImGui::InputFloat("Max timestamp", &ModifiedPhysXConfig.m_maxTimestep, 0.0f, 0.0f, "%.6f");
if (ImGui::Button("Update PhysX Config"))
{
UpdatePhysXConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ namespace SensorDebug
AZStd::vector<float> m_appFrequencies;
float m_maxFPS = 60.0f;
int m_historySize = 1000;




AzPhysics::Scene* m_scene = nullptr;
};
} // namespace SensorDebug
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,25 @@ namespace SensorDebug

void SensorDebugEditorSystemComponent::Activate()
{
SensorDebugSystemComponent::Activate();

AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
}

void SensorDebugEditorSystemComponent::Deactivate()
{
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
SensorDebugSystemComponent::Deactivate();

}

void SensorDebugEditorSystemComponent::OnStartPlayInEditorBegin()
{
ClearSensors();
SensorDebugSystemComponent::Activate();
}

void SensorDebugEditorSystemComponent::OnStopPlayInEditor()
{
ClearSensors();
SensorDebugSystemComponent::Deactivate();
}
} // namespace SensorDebug

0 comments on commit e2eb4bf

Please sign in to comment.