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

Queue more msgs to make sure get enough time to takeoff crazyflie #151

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions kr_mav_manager/include/kr_mav_manager/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ class MAVManager

// Services
ros::ServiceClient srv_transition_;

// Params
int motors_msg_queue_num_;
};

} // namespace kr_mav_manager
Expand Down
5 changes: 4 additions & 1 deletion kr_mav_manager/src/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ MAVManager::MAVManager(std::string ns)
// Disable motors
if(!this->set_motors(false))
ROS_ERROR("Could not disable motors");

// Params
nh_.param<int>("motors_msg_queue_num", motors_msg_queue_num_, 10);
}

void MAVManager::tracker_done_callback(const actionlib::SimpleClientGoalState &state,
Expand Down Expand Up @@ -624,7 +627,7 @@ bool MAVManager::set_motors(bool motors)
// Queue a few to make sure the signal gets through.
// Also, the crazyflie interface throttles commands to 30 Hz, so this needs
// to have a sufficent duration.
for(int i = 0; i < 10; i++)
for(int i = 0; i < motors_msg_queue_num_; i++)
{
pub_so3_command_.publish(so3_cmd);
pub_trpy_command_.publish(trpy_cmd);
Expand Down