Skip to content

Commit

Permalink
なんでそこにnotを入れたぁ! (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
HansRobo authored Aug 4, 2024
1 parent bf8bfb5 commit 96c4e6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crane_local_planner/src/crane_local_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void LocalPlannerComponent::callbackRobotCommands(const crane_msgs::msg::RobotCo
}
break;
case crane_msgs::msg::RobotCommand::SIMPLE_VELOCITY_TARGET_MODE:
if (not raw_command.simple_velocity_target_mode.empty()) {
if (raw_command.simple_velocity_target_mode.empty()) {
is_valid = false;
std::stringstream what;
what << "The robot " << static_cast<int>(raw_command.robot_id)
Expand Down
7 changes: 7 additions & 0 deletions crane_sender/include/crane_sender/sim_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ class SimSenderComponent : public SenderBase
cmd.set__veltangent(vel_local.x());
cmd.set__velnormal(vel_local.y());
} break;
case crane_msgs::msg::RobotCommand::SIMPLE_VELOCITY_TARGET_MODE: {
double vx = command.simple_velocity_target_mode.front().target_vx;
double vy = command.simple_velocity_target_mode.front().target_vy;
double theta = command.current_pose.theta + omega * delay_s;
cmd.set__veltangent(vx * cos(-theta) - vy * sin(-theta));
cmd.set__velnormal(vx * sin(-theta) + vy * cos(-theta));
} break;
default:
std::cout << "Invalid control mode" << std::endl;
break;
Expand Down

0 comments on commit 96c4e6e

Please sign in to comment.