servo value

This commit is contained in:
acki
2025-05-28 18:01:22 -04:00
parent 7dcf2c2430
commit c6631e4bd7
3 changed files with 23 additions and 8 deletions

View File

@@ -116,7 +116,7 @@ namespace Modelec
[this](const modelec_interfaces::msg::ActionServoPos::SharedPtr msg)
{
SendOrder("SERVO" + std::to_string(msg->id), {
"POS" + std::to_string(msg->pos), std::to_string(msg->angle)
"POS" + std::to_string(msg->pos), std::to_string(static_cast<int>(msg->angle * 100))
});
});

View File

@@ -695,16 +695,31 @@ namespace Modelec
}
}*/
if (!waypoint_queue_.empty())
if (await_rotate_)
{
waypoint_pub_->publish(waypoint_queue_.front().ToMsg());
waypoint_queue_.pop();
await_rotate_ = false;
waypoints_[waypoints_.size() - waypoint_queue_.size() - 1].reached = true;
waypoints_.clear();
for (auto& w : send_back_waypoints_)
{
waypoints_.emplace_back(w);
}
// SendWaypoint();
SendGoTo();
}
else
{
waypoints_.back().reached = true;
if (!waypoint_queue_.empty())
{
waypoint_pub_->publish(waypoint_queue_.front().ToMsg());
waypoint_queue_.pop();
waypoints_[waypoints_.size() - waypoint_queue_.size() - 1].reached = true;
}
else
{
waypoints_.back().reached = true;
}
}
}

View File

@@ -154,7 +154,7 @@ namespace Modelec
Transition(State::STOP, "Start prepare concert");
}*/
// TODO : check the time needed by the mission
else if (elapsed.seconds() < 75)
else if (elapsed.seconds() < 70)
{
Transition(State::DO_PREPARE_CONCERT, "Proceed to concert");
}
@@ -168,7 +168,7 @@ namespace Modelec
case State::DO_PREPARE_CONCERT:
if (!current_mission_)
{
current_mission_ = std::make_unique<PrepareConcertMission>(nav_, action_executor_, (now - match_start_time_).seconds() < 70);
current_mission_ = std::make_unique<PrepareConcertMission>(nav_, action_executor_, (now - match_start_time_).seconds() < 65);
current_mission_->Start(shared_from_this());
}
current_mission_->Update();