Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5384dd0

Browse files
committedMar 11, 2025·
RVO2Plannerでのプロファイルの値を出力
1 parent 9f62463 commit 5384dd0

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
 

‎crane_local_planner/include/crane_local_planner/rvo2_planner.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RVO2Planner : public LocalPlannerBase
2626
public:
2727
explicit RVO2Planner(rclcpp::Node & node);
2828

29-
void reflectWorldToRVOSim(const crane_msgs::msg::RobotCommands & msg);
29+
void reflectWorldToRVOSim(crane_msgs::msg::RobotCommands & msg);
3030

3131
crane_msgs::msg::RobotCommands extractRobotCommandsFromRVOSim(
3232
const crane_msgs::msg::RobotCommands & msg);

‎crane_local_planner/src/rvo2_planner.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RVO2Planner::RVO2Planner(rclcpp::Node & node)
5555
[this](const crane_msgs::msg::RobotFeedbackArray & msg) { latest_feedback = msg; });
5656
}
5757

58-
void RVO2Planner::reflectWorldToRVOSim(const crane_msgs::msg::RobotCommands & msg)
58+
void RVO2Planner::reflectWorldToRVOSim(crane_msgs::msg::RobotCommands & msg)
5959
{
6060
if (
6161
world_model->getMsg().play_situation.command_raw.value ==
@@ -70,7 +70,7 @@ void RVO2Planner::reflectWorldToRVOSim(const crane_msgs::msg::RobotCommands & ms
7070
}
7171
}
7272
// 味方ロボット:RVO内の位置・速度(=進みたい方向)の更新
73-
for (const auto & command : msg.robot_commands) {
73+
for (auto & command : msg.robot_commands) {
7474
rvo_sim->setAgentPosition(
7575
command.robot_id, RVO::Vector2(command.current_pose.x, command.current_pose.y));
7676
rvo_sim->setAgentPrefVelocity(command.robot_id, RVO::Vector2(0.f, 0.f));
@@ -151,6 +151,9 @@ void RVO2Planner::reflectWorldToRVOSim(const crane_msgs::msg::RobotCommands & ms
151151
max_vel = std::min(max_vel, 1.0);
152152
}
153153

154+
command.local_planner_config.final_planned_max_acceleration = acceleration;
155+
command.local_planner_config.final_planned_max_velocity = max_vel;
156+
154157
target_vel = target_vel.normalized() * max_vel;
155158

156159
if (target_vel.norm() < command.local_planner_config.terminal_velocity) {

‎crane_msgs/msg/control/LocalPlannerConfig.msg

+3
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ float32 terminal_velocity 0
1010
uint8 priority 0
1111

1212
float32 theta_tolerance 0.0
13+
14+
float32 final_planned_max_acceleration -1.0
15+
float32 final_planned_max_velocity -1.0

0 commit comments

Comments
 (0)
Please sign in to comment.