Skip to content

Commit

Permalink
Add acceleration to robotcommand for test with control
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorn committed Jun 12, 2024
1 parent e296b86 commit c35db7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roboteam_networking/proto/RobotCommands.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ message RobotCommand {

bool dribbler_on = 13; // If true, the robot will turn on its dribbler
bool wheels_off = 14; // If true, the robot will not move its wheels
double acceleration_x = 15; // (m/s^2) Target x acceleration of the robot
double acceleration_y = 16; // (m/s^2) Target y acceleration of the robot
}

message RobotCommands {
Expand Down
3 changes: 3 additions & 0 deletions roboteam_networking/src/RobotCommandsNetworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ proto::RobotCommands robotCommandsToProto(const rtt::RobotCommands& commands) {

protoCommand->set_dribbler_on(command.dribblerOn);
protoCommand->set_wheels_off(command.wheelsOff);
protoCommand->set_acceleration_x(command.acceleration.x);
protoCommand->set_acceleration_y(command.acceleration.y);
}

return protoCommands;
Expand All @@ -64,6 +66,7 @@ rtt::RobotCommands protoToRobotCommands(const proto::RobotCommands& protoCommand
for (const auto& protoCommand : protoCommands.robot_commands()) {
rtt::RobotCommand robotCommand = {.id = protoCommand.id(),
.velocity = Vector2(protoCommand.velocity_x(), protoCommand.velocity_y()),
.acceleration = Vector2(protoCommand.acceleration_x(), protoCommand.acceleration_y()),
.yaw = protoCommand.yaw(),
.targetAngularVelocity = protoCommand.angular_velocity(),
.useAngularVelocity = protoCommand.use_angular_velocity(),
Expand Down

0 comments on commit c35db7f

Please sign in to comment.