-
Notifications
You must be signed in to change notification settings - Fork 123
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
fuse -> ROS 2 fuse_publishers : Linting #305
Merged
methylDragon
merged 7 commits into
locusrobotics:rolling
from
methylDragon:rolling-publishers-linting
Jan 10, 2023
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
50abd94
Backport changes from fuse_models PR
methylDragon 6f2c315
Create redirection headers
methylDragon 2ce5fb2
Uncrustify fuse_publishers
methylDragon b9d98a7
Wrap comments (automatically)
methylDragon 6244407
Reorder includes
methylDragon b1fbcab
Manual linting
methylDragon 166b39a
Update topic joining and includes
methylDragon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
fuse_publishers/include/fuse_publishers/path_2d_publisher.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* | ||
* Software License Agreement (BSD License) | ||
* | ||
* Copyright (c) 2018, Locus Robotics | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided | ||
* with the distribution. | ||
* * Neither the name of the copyright holder nor the names of its | ||
* contributors may be used to endorse or promote products derived | ||
* from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
#ifndef FUSE_PUBLISHERS__PATH_2D_PUBLISHER_HPP_ | ||
#define FUSE_PUBLISHERS__PATH_2D_PUBLISHER_HPP_ | ||
|
||
#include <string> | ||
|
||
#include <fuse_core/async_publisher.hpp> | ||
#include <fuse_core/graph.hpp> | ||
#include <fuse_core/fuse_macros.hpp> | ||
#include <fuse_core/transaction.hpp> | ||
#include <fuse_core/uuid.hpp> | ||
#include <rclcpp/rclcpp.hpp> | ||
|
||
#include <nav_msgs/msg/path.hpp> | ||
#include <geometry_msgs/msg/pose_array.hpp> | ||
#include <geometry_msgs/msg/pose_stamped.hpp> | ||
|
||
|
||
namespace fuse_publishers | ||
{ | ||
|
||
/** | ||
* @brief Publisher plugin that publishes all of the stamped 2D poses as a nav_msgs::msg::Path | ||
* message. | ||
* | ||
* Parameters: | ||
* - device_id (uuid string, default: 00000000-0000-0000-0000-000000000000) The device/robot ID to | ||
* publish | ||
* - device_name (string) Used to generate the device/robot ID if the device_id is not provided | ||
* - frame_id (string, default: map) Name for the robot's map frame | ||
*/ | ||
class Path2DPublisher : public fuse_core::AsyncPublisher | ||
{ | ||
public: | ||
FUSE_SMART_PTR_DEFINITIONS(Path2DPublisher) | ||
|
||
/** | ||
* @brief Constructor | ||
*/ | ||
Path2DPublisher(); | ||
|
||
/** | ||
* @brief Destructor | ||
*/ | ||
virtual ~Path2DPublisher() = default; | ||
|
||
/** | ||
* @brief Shadowing extension to the AsyncPublisher::initialize call | ||
*/ | ||
void initialize( | ||
fuse_core::node_interfaces::NodeInterfaces<ALL_FUSE_CORE_NODE_INTERFACES> interfaces, | ||
const std::string & name) override; | ||
|
||
/** | ||
* @brief Perform any required post-construction initialization, such as advertising publishers or | ||
* reading from the parameter server. | ||
*/ | ||
void onInit() override; | ||
|
||
/** | ||
* @brief Notify the publisher about variables that have been added or removed | ||
* | ||
* @param[in] transaction A Transaction object, describing the set of variables that have been | ||
* added and/or removed | ||
* @param[in] graph A read-only pointer to the graph object, allowing queries to be | ||
* performed whenever needed | ||
*/ | ||
void notifyCallback( | ||
fuse_core::Transaction::ConstSharedPtr transaction, | ||
fuse_core::Graph::ConstSharedPtr graph) override; | ||
|
||
protected: | ||
fuse_core::node_interfaces::NodeInterfaces< | ||
fuse_core::node_interfaces::Base, | ||
fuse_core::node_interfaces::Parameters, | ||
fuse_core::node_interfaces::Topics, | ||
fuse_core::node_interfaces::Waitables | ||
> interfaces_; //!< Shadows AsyncPublisher interfaces_ | ||
|
||
fuse_core::UUID device_id_; //!< The UUID of the device to be published | ||
std::string frame_id_; //!< The name of the frame for this path | ||
|
||
//!< The publisher that sends the entire robot trajectory as a path | ||
rclcpp::Publisher<nav_msgs::msg::Path>::SharedPtr path_publisher_; | ||
|
||
//!< The publisher that sends the entire robot trajectory as a pose array | ||
rclcpp::Publisher<geometry_msgs::msg::PoseArray>::SharedPtr pose_array_publisher_; | ||
}; | ||
|
||
} // namespace fuse_publishers | ||
|
||
#endif // FUSE_PUBLISHERS__PATH_2D_PUBLISHER_HPP_ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 would recommend forbidding
b
from beginning with a/
or a~
. Either of those characters at the start meansb
is an absolute topic/service/action name which normally aren't affected by namespacing. If they normally aren't affected by namespacing, then I'd also expect them to not be able to be prepended with something.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.
Fixed!