Skip to content

Commit

Permalink
Merge pull request #329 from IMRCLab/issue300
Browse files Browse the repository at this point in the history
cpp backend: process all incoming radio messages
  • Loading branch information
Khaledwahba1994 committed Nov 15, 2023
2 parents 13cb67f + 4bad810 commit ad90477
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crazyflie/deps/crazyflie_tools
9 changes: 7 additions & 2 deletions crazyflie/src/crazyflie_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ class CrazyflieROS
subscription_cmd_position_ = node->create_subscription<crazyflie_interfaces::msg::Position>(name + "/cmd_position", rclcpp::SystemDefaultsQoS(), std::bind(&CrazyflieROS::cmd_position_changed, this, _1), sub_opt_cf_cmd);

// spinning timer
spin_timer_ = node->create_wall_timer(std::chrono::milliseconds(100), std::bind(&CrazyflieROS::spin_once, this), callback_group_cf_srv);
// used to process all incoming radio messages
spin_timer_ =
node->create_wall_timer(
std::chrono::milliseconds(1),
std::bind(&CrazyflieROS::spin_once, this), callback_group_cf_srv);


auto start = std::chrono::system_clock::now();
Expand Down Expand Up @@ -367,7 +371,8 @@ class CrazyflieROS

void spin_once()
{
cf_.spin_once();
// process all packets from the receive queue
cf_.processAllPackets();
}

std::string broadcastUri() const
Expand Down

0 comments on commit ad90477

Please sign in to comment.