Skip to content
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

Fix deprecated sub callback warnings #84

Merged
merged 1 commit into from
Aug 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class InteractiveMarkerClient
rclcpp::Client<visualization_msgs::srv::GetInteractiveMarkers>::SharedFuture future);

void processUpdate(
visualization_msgs::msg::InteractiveMarkerUpdate::SharedPtr msg);
visualization_msgs::msg::InteractiveMarkerUpdate::ConstSharedPtr msg);

bool transformInitialMessage();

Expand Down
3 changes: 2 additions & 1 deletion include/interactive_markers/interactive_marker_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ class InteractiveMarkerServer
std::shared_ptr<visualization_msgs::srv::GetInteractiveMarkers::Response> response);

// update marker pose & call user callback
void processFeedback(visualization_msgs::msg::InteractiveMarkerFeedback::SharedPtr feedback);
void processFeedback(
visualization_msgs::msg::InteractiveMarkerFeedback::ConstSharedPtr feedback);

// increase sequence number & publish an update
void publish(visualization_msgs::msg::InteractiveMarkerUpdate & update);
Expand Down
2 changes: 1 addition & 1 deletion include/interactive_markers/message_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MessageContext
MessageContext(
std::shared_ptr<tf2::BufferCoreInterface> tf_buffer_core,
const std::string & target_frame,
typename MsgT::SharedPtr msg,
typename MsgT::ConstSharedPtr msg,
bool enable_autocomplete_transparency = true);

MessageContext(const MessageContext &) = default;
Expand Down
2 changes: 1 addition & 1 deletion src/interactive_marker_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void InteractiveMarkerClient::processInitialMessage(
}

void InteractiveMarkerClient::processUpdate(
visualization_msgs::msg::InteractiveMarkerUpdate::SharedPtr msg)
visualization_msgs::msg::InteractiveMarkerUpdate::ConstSharedPtr msg)
{
// Ignore legacy "keep alive" messages
if (msg->type == msg->KEEP_ALIVE) {
Expand Down
2 changes: 1 addition & 1 deletion src/interactive_marker_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ void InteractiveMarkerServer::getInteractiveMarkersCallback(
}

void InteractiveMarkerServer::processFeedback(
visualization_msgs::msg::InteractiveMarkerFeedback::SharedPtr feedback)
visualization_msgs::msg::InteractiveMarkerFeedback::ConstSharedPtr feedback)
{
std::unique_lock<std::recursive_mutex> lock(mutex_);

Expand Down
2 changes: 1 addition & 1 deletion src/message_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ template<class MsgT>
MessageContext<MsgT>::MessageContext(
std::shared_ptr<tf2::BufferCoreInterface> tf_buffer_core,
const std::string & target_frame,
typename MsgT::SharedPtr _msg,
typename MsgT::ConstSharedPtr _msg,
bool enable_autocomplete_transparency)
: tf_buffer_core_(tf_buffer_core),
target_frame_(target_frame),
Expand Down
4 changes: 2 additions & 2 deletions test/interactive_markers/mock_interactive_marker_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MockInteractiveMarkerClient : public rclcpp::Node
SharedFuture requestInteractiveMarkers();

uint32_t updates_received;
visualization_msgs::msg::InteractiveMarkerUpdate::SharedPtr last_update_message;
visualization_msgs::msg::InteractiveMarkerUpdate::ConstSharedPtr last_update_message;
visualization_msgs::srv::GetInteractiveMarkers::Response::SharedPtr last_response_message;

std::string topic_namespace_;
Expand All @@ -81,7 +81,7 @@ MockInteractiveMarkerClient::MockInteractiveMarkerClient(
subscription_ = create_subscription<visualization_msgs::msg::InteractiveMarkerUpdate>(
topic_namespace_ + "/update",
1,
[this](const visualization_msgs::msg::InteractiveMarkerUpdate::SharedPtr update)
[this](const visualization_msgs::msg::InteractiveMarkerUpdate::ConstSharedPtr update)
{
RCLCPP_INFO(this->get_logger(), "Update received");
++this->updates_received;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ MockInteractiveMarkerServer::MockInteractiveMarkerServer(
subscription_ = create_subscription<visualization_msgs::msg::InteractiveMarkerFeedback>(
topic_namespace_ + "/feedback",
10,
[this](const visualization_msgs::msg::InteractiveMarkerFeedback::SharedPtr feedback)
[this](const visualization_msgs::msg::InteractiveMarkerFeedback::ConstSharedPtr feedback)
{
(void)feedback;
RCLCPP_INFO(this->get_logger(), "Feedback received");
Expand Down