-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aditya Pande <[email protected]>
- Loading branch information
1 parent
ba42a2b
commit 7d2ced7
Showing
8 changed files
with
77 additions
and
11 deletions.
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
3 changes: 2 additions & 1 deletion
3
...l_ros2_rules/ros2/tools/roslaunch_base.py → ...l_ros2_rules/ros2/tools/roslaunch_util.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<launch> | ||
<executable cmd="python3 ros2_example_apps/roslaunch_eg_nodes/eg_talker.py"/> | ||
<executable cmd="./ros2_example_apps/eg_listener"/> | ||
</launch> |
31 changes: 31 additions & 0 deletions
31
ros2_example_bazel_installed/ros2_example_apps/roslaunch_eg_nodes/eg_listener.cpp
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,31 @@ | ||
#include <memory> | ||
|
||
#include "rclcpp/rclcpp.hpp" | ||
#include "std_msgs/msg/string.hpp" | ||
using std::placeholders::_1; | ||
|
||
class MinimalSubscriber : public rclcpp::Node | ||
{ | ||
public: | ||
MinimalSubscriber() | ||
: Node("minimal_subscriber") | ||
{ | ||
subscription_ = this->create_subscription<std_msgs::msg::String>( | ||
"topic", 10, std::bind(&MinimalSubscriber::topic_callback, this, _1)); | ||
} | ||
|
||
private: | ||
void topic_callback(const std_msgs::msg::String::SharedPtr msg) const | ||
{ | ||
RCLCPP_INFO(this->get_logger(), "I heard: '%s'", msg->data.c_str()); | ||
} | ||
rclcpp::Subscription<std_msgs::msg::String>::SharedPtr subscription_; | ||
}; | ||
|
||
int main(int argc, char * argv[]) | ||
{ | ||
rclcpp::init(argc, argv); | ||
rclcpp::spin(std::make_shared<MinimalSubscriber>()); | ||
rclcpp::shutdown(); | ||
return 0; | ||
} |
File renamed without changes.