rename ros2aria class
This commit is contained in:
parent
d293fda07c
commit
7851d903d5
@ -14,18 +14,18 @@ using std::placeholders::_1;
|
|||||||
using std::placeholders::_2;
|
using std::placeholders::_2;
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
class MinimalSubscriber : public rclcpp::Node
|
class Ros2Aria : public rclcpp::Node
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MinimalSubscriber()
|
Ros2Aria()
|
||||||
: Node("minimal_subscriber")
|
: Node("minimal_subscriber")
|
||||||
{
|
{
|
||||||
this->robot = std::make_shared<RAIIBot>(this, "/dev/ttyS0");
|
this->robot = std::make_shared<RAIIBot>(this, "/dev/ttyS0");
|
||||||
|
|
||||||
RCLCPP_INFO(this->get_logger(), "starting subscribers and services");
|
RCLCPP_INFO(this->get_logger(), "starting subscribers and services");
|
||||||
cmd_vel_sub_ = this->create_subscription<geometry_msgs::msg::Twist>(
|
cmd_vel_sub_ = this->create_subscription<geometry_msgs::msg::Twist>(
|
||||||
"cmd_vel", 10, std::bind(&MinimalSubscriber::cmd_vel_callback, this, _1));
|
"cmd_vel", 10, std::bind(&Ros2Aria::cmd_vel_callback, this, _1));
|
||||||
stop_service_ = this->create_service<std_srvs::srv::Empty>("stop", std::bind(&MinimalSubscriber::stop, this, _1, _2));
|
stop_service_ = this->create_service<std_srvs::srv::Empty>("stop", std::bind(&Ros2Aria::stop, this, _1, _2));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -80,7 +80,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
// return 0;
|
// return 0;
|
||||||
rclcpp::init(argc, argv);
|
rclcpp::init(argc, argv);
|
||||||
rclcpp::spin(std::make_shared<MinimalSubscriber>());
|
rclcpp::spin(std::make_shared<Ros2Aria>());
|
||||||
rclcpp::shutdown();
|
rclcpp::shutdown();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user