-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add Spline Path Publisher Component #108
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not run the code, only browsed diagonally. Some nitpicks listed.
Gems/RobotecSplineTools/Code/Source/Clients/SplinePublisher.cpp
Outdated
Show resolved
Hide resolved
Gems/RobotecSplineTools/Code/Source/Clients/SplinePublisher.cpp
Outdated
Show resolved
Hide resolved
Gems/RobotecSplineTools/Code/Source/Clients/SplinePublisher.cpp
Outdated
Show resolved
Hide resolved
Gems/RobotecSplineTools/Code/Source/Clients/SplinePublisher.cpp
Outdated
Show resolved
Hide resolved
Gems/RobotecSplineTools/Code/Source/Clients/SplinePublisher.cpp
Outdated
Show resolved
Hide resolved
Gems/RobotecSplineTools/Code/Include/SplineTools/SplineToolsTypeIds.h
Outdated
Show resolved
Hide resolved
Gems/RobotecSplineTools/Code/Source/Clients/SplinePublisher.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
serializeContext->Class<SplinePublisher, AZ::Component>()->Version(0)->Field("m_config", &SplinePublisher::m_config); | ||
if (auto editContext = serializeContext->GetEditContext()) | ||
{ | ||
editContext->Class<SplinePublisher>("SplinePathPublisher", "Enables to publish spline as a ros2 path.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
editContext->Class<SplinePublisher>("SplinePathPublisher", "Enables to publish spline as a ros2 path.") | |
editContext->Class<SplinePublisher>("SplinePathPublisher", "Enables to publish spline as a ROS 2 path.") |
SplinePublisherConfiguration::SplinePublisherConfiguration() | ||
{ | ||
m_TopicConfig.m_type = "nav_msgs::msg::Path"; | ||
m_TopicConfig.m_topic = "spline_path"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Technically, the "spline path" might be confusing, because the spline doesn't move along the route defined by a path (like "tractor path" for example). We could use just spline
or something like spline_points
.
m_TopicConfig.m_topic = "spline_path"; | |
m_TopicConfig.m_topic = "spline"; |
const ROS2::ROS2FrameComponent* ros2Frame = GetEntity()->FindComponent<ROS2::ROS2FrameComponent>(); | ||
if (!ros2Frame) | ||
{ | ||
AZ_Warning("SplinePublisher::Activate", false, "ROS2 Frame Component is not available!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AZ_Warning("SplinePublisher::Activate", false, "ROS2 Frame Component is not available!"); | |
AZ_Warning("SplinePublisher::Activate", false, "ROS 2 frame component is not available!"); |
const ROS2::ROS2FrameComponent* ros2Frame = GetEntity()->FindComponent<ROS2::ROS2FrameComponent>(); | ||
if (!ros2Frame) | ||
{ | ||
AZ_Warning("SplinePublisher::PublishSplineAsPath", false, "ROS2 Frame Component is not available!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AZ_Warning("SplinePublisher::PublishSplineAsPath", false, "ROS2 Frame Component is not available!"); | |
AZ_Warning("SplinePublisher::PublishSplineAsPath", false, "ROS 2 frame component is not available!"); |
const ROS2::ROS2FrameComponent* ros2Frame = GetEntity()->FindComponent<ROS2::ROS2FrameComponent>(); | ||
if (!ros2Frame) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, the ros2Frame
can be assumed to exist because you connect to Tick bus after the check in line 68.
As far as I know, you can't remove/add components when entity is active, therefore we can be sure that nothing strange happen between the ticks (without deactivate/activate and frame re-check). Additionally, you can save the reference and reuse it here if needed - no need to find component in every tick.
About:
This PR adds a component with a spline path publisher.
It exposes current entity attached spline as a path available for ros2.