Skip to content

Get bullet information from referee system #50

@isa-9

Description

@isa-9

Specification

We want to be able to get the values of bullet speed from the referee system and to see them in the PC by UART

Implementation

We can use the RefSerial::getRobotData method to get the robot information that contains the bullet speed (TurretData). There is an instance of RefSerial in the drivers singleton

We can also use the uart transmitter (also in drivers) to send the data to the PC.

Ressources

Here's an example we already have in the code (ChassisSubsystem::refresh())

prevDebugTime = tap::arch::clock::getTimeMilliseconds();
char buffer[500];

// Front right debug message
int nBytes = sprintf (buffer, "FR-RPM: %i, SETPOINT: %i\n",
                      frontRightMotor.getShaftRPM(),
                      (int)frontRightDesiredRpm);
drivers->uart.write(Uart::UartPort::Uart8,(uint8_t*) buffer, nBytes+1);

In this example, the Uart port 8 is used, so we'll have to connect the CAN to "Pin" cable to the right port of the Board A (see images). Make sure the T from the UART port is connected to the Rx pin from the adaptator and the R from the UART port is connected to the Tx pin of the adaptator. You can then open a serial monitor (like the on from Arduino IDE for example) and set the baud rate to 230400 to see the data sent from by the Board A
20241120_205737_HDR
20241120_205801_HDR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions