Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix shoot profile bug #142

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions source/sender/nrf.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "nrf.h"

Check notice on line 1 in source/sender/nrf.cpp

View workflow job for this annotation

GitHub Actions / check

Run clang-format on source/sender/nrf.cpp

File source/sender/nrf.cpp does not conform to Custom style guidelines. (lines 106)

#include "protocol/writer.h"

Expand All @@ -6,22 +6,22 @@
{

static Common::Vec2 shoot_coeffs[Common::Config::Common::kMaxRobots] = {
{4.45f, 2.59f}, // 0
{4.48f, 2.6f}, // 1
{3.42f, 3.43f}, // 2
{4.45f, 2.59f}, // 0
{4.48f, 2.6f}, // 1
{3.42f, 3.43f}, // 2
{6.22f, -0.43f}, // 3
{9.74f, 12.8f}, // 4
{4.46f, 2.66f}, // 5
{9.74f, 12.8f}, // 6
{4.02f, 3.38f}, // 7
{1.0f, 0.0f}, // 8*
{1.0f, 0.0f}, // 9*
{1.0f, 0.0f}, // 10*
{1.0f, 0.0f}, // 11*
{1.0f, 0.0f}, // 12*
{1.0f, 0.0f}, // 13*
{1.0f, 0.0f}, // 14*
{1.0f, 0.0f}, // 15*
{9.74f, 12.8f}, // 4
{4.46f, 2.66f}, // 5
{9.74f, 12.8f}, // 6
{4.02f, 3.38f}, // 7
{1.0f, 0.0f}, // 8*
{1.0f, 0.0f}, // 9*
{1.0f, 0.0f}, // 10*
{1.0f, 0.0f}, // 11*
{1.0f, 0.0f}, // 12*
{1.0f, 0.0f}, // 13*
{1.0f, 0.0f}, // 14*
{1.0f, 0.0f}, // 15*
};

static Common::Vec2 chip_coeffs[Common::Config::Common::kMaxRobots] = {
Expand Down Expand Up @@ -65,7 +65,7 @@

buff_idx = 0;
auto buffer = commUDP->getBuffer();
for (int i = 0; i < buffer.size(); i++)

Check warning on line 68 in source/sender/nrf.cpp

View workflow job for this annotation

GitHub Actions / build (macos, debug)

comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]

Check warning on line 68 in source/sender/nrf.cpp

View workflow job for this annotation

GitHub Actions / build (macos, release)

comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]

Check warning on line 68 in source/sender/nrf.cpp

View workflow job for this annotation

GitHub Actions / build (ubuntu, release)

comparison of integer expressions of different signedness: ‘int’ and ‘std::span<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]

Check warning on line 68 in source/sender/nrf.cpp

View workflow job for this annotation

GitHub Actions / build (ubuntu, debug)

comparison of integer expressions of different signedness: ‘int’ and ‘std::span<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
{
buffer[i] = 0x00;
}
Expand Down Expand Up @@ -102,8 +102,9 @@
convert_float_to_2x_buff(data + 9, command.current_angle.deg());
if (command.shoot > 0)
{
getCalibratedShootPow(Common::config().soccer.kick_tune_coef * command.shoot, shoot_coeffs[command.vision_id]);
data[11] = command.shoot;

data[11] = static_cast<unsigned char> (getCalibratedShootPow(Common::config().soccer.kick_tune_coef * command.shoot,
shoot_coeffs[command.vision_id]));
data[12] = 0x00;
}
else if (command.chip > 0)
Expand Down
Loading