Skip to content

Commit

Permalink
[fix]colcon test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramune6110 committed Feb 3, 2024
1 parent ce78ca6 commit 969c5bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
10 changes: 2 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@ find_package(std_msgs REQUIRED)

# talker
add_executable(talker src/publisher_member_function.cpp)
ament_target_dependencies(talker
rclcpp
std_msgs
)
ament_target_dependencies(talker rclcpp std_msgs)

# listener
add_executable(listener src/subscriber_member_function.cpp)
ament_target_dependencies(listener
rclcpp
std_msgs
)
ament_target_dependencies(listener rclcpp std_msgs)

# float32_pub
add_executable(float32_pub src/float32_pub.cpp)
Expand Down
2 changes: 1 addition & 1 deletion launch/tutorial_publishers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def generate_launch_description():
executable='float32_pub',
output="screen",
)

nodes = [
minimal_publisher_node,
minimal_subscriber_node,
Expand Down
8 changes: 3 additions & 5 deletions src/float32_pub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ class Float32PubComponent : public rclcpp::Node
: Node("float32_pub")
{
publisher_ = create_publisher<std_msgs::msg::Float32>("/data", 10);
timer_ =
create_wall_timer(
std::chrono::seconds(1),
std::bind(&Float32PubComponent::publishData, this));
timer_ = create_wall_timer(
std::chrono::seconds(1), std::bind(&Float32PubComponent::publishData, this));
}

private:
Expand Down Expand Up @@ -48,4 +46,4 @@ int main(int argc, char * argv[])
rclcpp::spin(std::make_shared<Float32PubComponent>());
rclcpp::shutdown();
return 0;
}
}

0 comments on commit 969c5bb

Please sign in to comment.