Skip to content

Commit

Permalink
some bugfixes
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Dąbrowski <[email protected]>
  • Loading branch information
adamdbrw committed Jan 4, 2023
1 parent 1516a27 commit f513870
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 1 addition & 4 deletions Gems/ROS2/Code/Source/Lidar/ROS2LidarSensorComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,21 @@ namespace ROS2
serialize->Class<ROS2LidarSensorComponent, ROS2SensorComponent>()
->Version(1)
->Field("lidarModel", &ROS2LidarSensorComponent::m_lidarModel)
->Field("SensorConfiguration", &ROS2LidarSensorComponent::m_sensorConfiguration)
;

if (AZ::EditContext* ec = serialize->GetEditContext())
{
ec->Class<ROS2LidarSensorComponent>("ROS2 Lidar Sensor", "[Simple Lidar component]")
ec->Class<ROS2LidarSensorComponent>("ROS2 Lidar Sensor", "Lidar sensor component")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game"))
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2LidarSensorComponent::m_lidarModel, "Lidar Model", "Lidar model")
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2LidarSensorComponent::m_sensorConfiguration, "Sensor configuration", "Sensor configuration")
;
}
}
}

ROS2LidarSensorComponent::ROS2LidarSensorComponent()
{ // TODO - replace with EditorComponent behavior
SensorConfiguration sc;
PublisherConfiguration pc;
pc.m_type = "sensor_msgs::msg::PointCloud2";
pc.m_topic = "pc";
Expand Down
8 changes: 8 additions & 0 deletions Gems/ROS2/Code/Source/Sensor/ROS2SensorComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ namespace ROS2
{
serialize->Class<ROS2SensorComponent, AZ::Component>()
->Version(1)
->Field("SensorConfiguration", &ROS2SensorComponent::m_sensorConfiguration)
;

if (AZ::EditContext* ec = serialize->GetEditContext())
{
ec->Class<ROS2SensorComponent>("ROS2 Sensor", "Base component for sensors")
->DataElement(AZ::Edit::UIHandlers::Default, &ROS2SensorComponent::m_sensorConfiguration, "Sensor configuration", "Sensor configuration")
;
}
}
}

Expand Down
5 changes: 1 addition & 4 deletions Gems/ROS2/Code/Source/Sensor/SensorConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@ namespace ROS2

if (AZ::EditContext* ec = serializeContext->GetEditContext())
{
ec->Class<SensorConfiguration>("ROS2 Sensor Component", "[Base component for sensors]")
ec->Class<SensorConfiguration>("ROS2 Sensor Configuration", "Sensor configuration")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->DataElement(AZ::Edit::UIHandlers::Default, &SensorConfiguration::m_visualise, "Visualise", "Visualise")
->DataElement(AZ::Edit::UIHandlers::Default, &SensorConfiguration::m_publishingEnabled, "Publishing Enabled", "Toggle publishing for topic")
->DataElement(AZ::Edit::UIHandlers::Default, &SensorConfiguration::m_frequency, "Frequency", "Frequency of publishing")
->Attribute(AZ::Edit::Attributes::Min, 1)
->Attribute(AZ::Edit::Attributes::Max, 100)
->Attribute(AZ::Edit::Attributes::Step, 1)
->DataElement(AZ::Edit::UIHandlers::Default, &SensorConfiguration::m_publishersConfigurations, "Publishers", "Publishers")
->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, false)
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
Expand Down

0 comments on commit f513870

Please sign in to comment.