Skip to content

Commit d5ad952

Browse files
committed
fix: ロボット向き角度の符号反転バグを修正
applyCommand 内で getDir() から current_theta を計算する際に 誤って符号を反転させていた(-robot->getDir())。 getDir() は SSL vision の向き規約に従っており、 set_orientation が getDir() * pi/180 で設定されているため、 角度変換に符号反転は不要。
1 parent 2de12f3 commit d5ad952

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ibis_command_receiver.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ void IbisCommandReceiver::applyCommand(int robot_id, const IbisCommand& cmd, Rob
123123
return;
124124
}
125125

126-
// Current robot orientation in radians (grSim convention: negative of degrees)
127-
double current_theta = -robot->getDir() * M_PI / 180.0;
126+
// Current robot orientation in radians.
127+
// getDir() is in degrees and matches the SSL vision orientation convention
128+
// (set_orientation = getDir() * pi/180), so no sign flip is needed.
129+
double current_theta = robot->getDir() * M_PI / 180.0;
128130

129131
double theta_error = cmd.target_global_theta - current_theta;
130132
while (theta_error > M_PI) theta_error -= 2.0 * M_PI;

0 commit comments

Comments
 (0)