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 typo, soprt_request should be sport_request #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions example/src/src/sport_mode_ctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
#include "common/ros2_sport_client.h"

using std::placeholders::_1;
// Create a soprt_request class for soprt commond request
class soprt_request : public rclcpp::Node
// Create a sport_request class for soprt commond request
class sport_request : public rclcpp::Node
{
public:
soprt_request() : Node("req_sender")
sport_request() : Node("req_sender")
{
// the state_suber is set to subscribe "sportmodestate" topic
state_suber = this->create_subscription<unitree_go::msg::SportModeState>(
"sportmodestate", 10, std::bind(&soprt_request::state_callback, this, _1));
"sportmodestate", 10, std::bind(&sport_request::state_callback, this, _1));
// the req_puber is set to subscribe "/api/sport/request" topic with dt
req_puber = this->create_publisher<unitree_api::msg::Request>("/api/sport/request", 10);
timer_ = this->create_wall_timer(std::chrono::milliseconds(int(dt * 1000)), std::bind(&soprt_request::timer_callback, this));
timer_ = this->create_wall_timer(std::chrono::milliseconds(int(dt * 1000)), std::bind(&sport_request::timer_callback, this));

t = -1; // Runing time count
};
Expand Down Expand Up @@ -102,7 +102,7 @@ int main(int argc, char *argv[])
rclcpp::init(argc, argv); // Initialize rclcpp
rclcpp::TimerBase::SharedPtr timer_; // Create a timer callback object to send sport request in time intervals

rclcpp::spin(std::make_shared<soprt_request>()); //Run ROS2 node
rclcpp::spin(std::make_shared<sport_request>()); //Run ROS2 node

rclcpp::shutdown();
return 0;
Expand Down