Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
temp commit to debug CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hhenry01 committed Mar 7, 2024
1 parent 253526e commit 7a87cdc
Showing 1 changed file with 96 additions and 96 deletions.
192 changes: 96 additions & 96 deletions projects/local_transceiver/test/test_local_transceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,99 +68,99 @@ TEST_F(TestLocalTransceiver, debugSendTest)
EXPECT_EQ(lcl_trns_->debugSend(AT::CHECK_CONN), AT::Line(AT::STATUS_OK).str_);
}

/**
* @brief Send a binary string to virtual_iridium and verify it is received
* Using gps, ais, wind, batteries, generic sensors, local path data
*/
TEST_F(TestLocalTransceiver, sendData)
{
constexpr float holder = 14.3;
constexpr int32_t holder_int = 11;

// custom inferfaces used
custom_interfaces::msg::GPS gps;
custom_interfaces::msg::AISShips ais;
custom_interfaces::msg::WindSensors wind;
custom_interfaces::msg::Batteries batteries;
custom_interfaces::msg::GenericSensors sensors;
custom_interfaces::msg::LPathData local_paths;

// assign gps data
gps.heading.set__heading(holder);
gps.lat_lon.set__latitude(holder);
gps.lat_lon.set__longitude(holder);
gps.speed.set__speed(holder);

// assign ais data
custom_interfaces::msg::HelperAISShip ship_one;
custom_interfaces::msg::HelperHeading heading_one;
custom_interfaces::msg::HelperLatLon lat_lon_one;
custom_interfaces::msg::HelperSpeed speed_one;
custom_interfaces::msg::HelperROT rotation_one;
custom_interfaces::msg::HelperDimension width_one;
custom_interfaces::msg::HelperDimension length_one;

heading_one.set__heading(holder);
lat_lon_one.set__latitude(holder);
lat_lon_one.set__longitude(holder);
speed_one.set__speed(holder);
rotation_one.set__rot(holder_int);
width_one.set__dimension(holder);
length_one.set__dimension(holder);

ship_one.set__id(holder_int);
ship_one.set__cog(heading_one);
ship_one.set__lat_lon(lat_lon_one);
ship_one.set__sog(speed_one);
ship_one.set__rot(rotation_one);
ship_one.set__width(width_one);
ship_one.set__length(length_one);

ais.set__ships({ship_one});

// assign wind data
custom_interfaces::msg::WindSensor wind_data_one;
custom_interfaces::msg::WindSensor wind_data_two;
custom_interfaces::msg::HelperSpeed wind_speed;

wind_data_one.set__direction(holder_int);
wind_speed.set__speed(holder);
wind_data_one.set__speed(wind_speed);
wind_data_two.set__direction(holder_int);
wind_data_two.set__speed(wind_speed);
wind.set__wind_sensors({wind_data_one, wind_data_two});

// assign batteries data
custom_interfaces::msg::HelperBattery battery_one;
custom_interfaces::msg::HelperBattery battery_two;

battery_one.set__current(holder);
battery_one.set__voltage(holder);
battery_two.set__current(holder);
battery_two.set__voltage(holder);
batteries.set__batteries({battery_one, battery_two});

// assign generic sensors data
custom_interfaces::msg::HelperGenericSensor sensor;

sensor.set__data(holder_int);
sensor.set__id(holder_int);
sensors.set__generic_sensors({sensor});

// assign local path data
custom_interfaces::msg::Path local_path;
custom_interfaces::msg::HelperLatLon lat_lon;
lat_lon.set__latitude(holder);
lat_lon.set__longitude(holder);
local_path.set__waypoints({lat_lon});
local_paths.set__local_path({local_path});

// update sensors and send
lcl_trns_->updateSensor(wind);
lcl_trns_->updateSensor(gps);
lcl_trns_->updateSensor(ais);
lcl_trns_->updateSensor(batteries);
lcl_trns_->updateSensor(sensors);
lcl_trns_->updateSensor(local_paths);
lcl_trns_->send();
}
// /**
// * @brief Send a binary string to virtual_iridium and verify it is received
// * Using gps, ais, wind, batteries, generic sensors, local path data
// */
// TEST_F(TestLocalTransceiver, sendData)
// {
// constexpr float holder = 14.3;
// constexpr int32_t holder_int = 11;

// // custom inferfaces used
// custom_interfaces::msg::GPS gps;
// custom_interfaces::msg::AISShips ais;
// custom_interfaces::msg::WindSensors wind;
// custom_interfaces::msg::Batteries batteries;
// custom_interfaces::msg::GenericSensors sensors;
// custom_interfaces::msg::LPathData local_paths;

// // assign gps data
// gps.heading.set__heading(holder);
// gps.lat_lon.set__latitude(holder);
// gps.lat_lon.set__longitude(holder);
// gps.speed.set__speed(holder);

// // assign ais data
// custom_interfaces::msg::HelperAISShip ship_one;
// custom_interfaces::msg::HelperHeading heading_one;
// custom_interfaces::msg::HelperLatLon lat_lon_one;
// custom_interfaces::msg::HelperSpeed speed_one;
// custom_interfaces::msg::HelperROT rotation_one;
// custom_interfaces::msg::HelperDimension width_one;
// custom_interfaces::msg::HelperDimension length_one;

// heading_one.set__heading(holder);
// lat_lon_one.set__latitude(holder);
// lat_lon_one.set__longitude(holder);
// speed_one.set__speed(holder);
// rotation_one.set__rot(holder_int);
// width_one.set__dimension(holder);
// length_one.set__dimension(holder);

// ship_one.set__id(holder_int);
// ship_one.set__cog(heading_one);
// ship_one.set__lat_lon(lat_lon_one);
// ship_one.set__sog(speed_one);
// ship_one.set__rot(rotation_one);
// ship_one.set__width(width_one);
// ship_one.set__length(length_one);

// ais.set__ships({ship_one});

// // assign wind data
// custom_interfaces::msg::WindSensor wind_data_one;
// custom_interfaces::msg::WindSensor wind_data_two;
// custom_interfaces::msg::HelperSpeed wind_speed;

// wind_data_one.set__direction(holder_int);
// wind_speed.set__speed(holder);
// wind_data_one.set__speed(wind_speed);
// wind_data_two.set__direction(holder_int);
// wind_data_two.set__speed(wind_speed);
// wind.set__wind_sensors({wind_data_one, wind_data_two});

// // assign batteries data
// custom_interfaces::msg::HelperBattery battery_one;
// custom_interfaces::msg::HelperBattery battery_two;

// battery_one.set__current(holder);
// battery_one.set__voltage(holder);
// battery_two.set__current(holder);
// battery_two.set__voltage(holder);
// batteries.set__batteries({battery_one, battery_two});

// // assign generic sensors data
// custom_interfaces::msg::HelperGenericSensor sensor;

// sensor.set__data(holder_int);
// sensor.set__id(holder_int);
// sensors.set__generic_sensors({sensor});

// // assign local path data
// custom_interfaces::msg::Path local_path;
// custom_interfaces::msg::HelperLatLon lat_lon;
// lat_lon.set__latitude(holder);
// lat_lon.set__longitude(holder);
// local_path.set__waypoints({lat_lon});
// local_paths.set__local_path({local_path});

// // update sensors and send
// lcl_trns_->updateSensor(wind);
// lcl_trns_->updateSensor(gps);
// lcl_trns_->updateSensor(ais);
// lcl_trns_->updateSensor(batteries);
// lcl_trns_->updateSensor(sensors);
// lcl_trns_->updateSensor(local_paths);
// lcl_trns_->send();
// }

0 comments on commit 7a87cdc

Please sign in to comment.