Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #35 from RoboTeamTwente/fix/dribbler_command_sim
Browse files Browse the repository at this point in the history
Fix rotating the velocity vector the wrong way
  • Loading branch information
JaroKuiken authored Jun 19, 2021
2 parents e8385eb + bd78e86 commit 419f979
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SSLSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ proto::sim::RobotCommand SSLSimulator::convert_command(const proto::RobotCommand
float robot_angle = 0.0;
std::shared_ptr<proto::WorldRobot> findBot = rtt::robothub::utils::getWorldBot(command.id(),is_yellow, world);
if(findBot){
robot_angle = findBot->angle();
robot_angle = - findBot->angle();
}else{
std::cout<<"could not find robot!"<<std::endl;
}
float forward = cosf(robot_angle) * command.vel().x() - sinf(robot_angle) * command.vel().y();
float left = sinf(robot_angle) * command.vel().x() + cosf(robot_angle) * command.vel().y();
Expand Down

0 comments on commit 419f979

Please sign in to comment.