diff --git a/roboteam_networking/proto/RobotCommands.proto b/roboteam_networking/proto/RobotCommands.proto index 43efddcb5..b3d7d71cd 100644 --- a/roboteam_networking/proto/RobotCommands.proto +++ b/roboteam_networking/proto/RobotCommands.proto @@ -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 { diff --git a/roboteam_networking/src/RobotCommandsNetworker.cpp b/roboteam_networking/src/RobotCommandsNetworker.cpp index 9b488b5bc..7a8853d09 100644 --- a/roboteam_networking/src/RobotCommandsNetworker.cpp +++ b/roboteam_networking/src/RobotCommandsNetworker.cpp @@ -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; @@ -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(),