Skip to content
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
5 changes: 4 additions & 1 deletion frootspi_conductor/src/conductor_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "frootspi_conductor/conductor_component.hpp"
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/qos.hpp"

namespace frootspi_conductor
{
Expand All @@ -31,7 +32,9 @@ Conductor::Conductor(const rclcpp::NodeOptions & options)
using namespace std::placeholders; // for _1, _2, _3...

sub_command_ = create_subscription<RobotCommand>(
"command", 10, std::bind(&Conductor::callback_commands, this, _1));
"command",
rclcpp::QoS(10).best_effort(),
std::bind(&Conductor::callback_commands, this, _1));

pub_target_velocity_ = create_publisher<geometry_msgs::msg::Twist>("target_velocity", 10);
pub_dribble_power_ = create_publisher<frootspi_msgs::msg::DribblePower>("dribble_power", 10);
Expand Down
19 changes: 13 additions & 6 deletions frootspi_hardware/src/kicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,19 @@ bool Kicker::kickStraight(uint32_t powerMmps)
if (this->debug_mode_) {return false;}

uint32_t sleep_time_usec;
if (powerMmps < 2000) sleep_time_usec = OPENTIME_1MS;
else if (powerMmps < 3000) sleep_time_usec = OPENTIME_2MS;
else if (powerMmps < 4000) sleep_time_usec = OPENTIME_3MS;
else if (powerMmps < 5000) sleep_time_usec = OPENTIME_4MS;
else if (powerMmps < 6000) sleep_time_usec = OPENTIME_5MS;
else sleep_time_usec = OPENTIME_6MS;
if (powerMmps < 2000) {
sleep_time_usec = OPENTIME_1MS;
} else if (powerMmps < 3000) {
sleep_time_usec = OPENTIME_2MS;
} else if (powerMmps < 4000) {
sleep_time_usec = OPENTIME_3MS;
} else if (powerMmps < 5000) {
sleep_time_usec = OPENTIME_4MS;
} else if (powerMmps < 6000) {
sleep_time_usec = OPENTIME_5MS;
} else {
sleep_time_usec = OPENTIME_6MS;
}

if (sleep_time_usec > MAX_SLEEP_TIME_USEC_FOR_STRAIGHT) {
sleep_time_usec = MAX_SLEEP_TIME_USEC_FOR_STRAIGHT;
Expand Down