diff --git a/dfall_ws/src/dfall_pkg/CMakeLists.txt b/dfall_ws/src/dfall_pkg/CMakeLists.txt index 6542cb7f529927b398a5b1aca99da94b4c2954fd..2c1541a1f174a9632645f0cd4a5a8536a45a557c 100755 --- a/dfall_ws/src/dfall_pkg/CMakeLists.txt +++ b/dfall_ws/src/dfall_pkg/CMakeLists.txt @@ -400,6 +400,7 @@ add_executable(FlyingAgentClient src/nodes/FlyingAgentClient.cpp add_executable(BatteryMonitor src/nodes/BatteryMonitor.cpp src/classes/GetParamtersAndNamespaces.cpp) add_executable(CrazyRadioEmulator src/nodes/CrazyRadioEmulator.cpp + src/classes/QuadrotorSimulator.cpp src/classes/GetParamtersAndNamespaces.cpp) add_executable(CsoneControllerService src/nodes/CsoneControllerService.cpp src/classes/GetParamtersAndNamespaces.cpp) diff --git a/dfall_ws/src/dfall_pkg/include/nodes/CrazyRadioEmulator.h b/dfall_ws/src/dfall_pkg/include/nodes/CrazyRadioEmulator.h index 3a4d7ee64ca05f3b39e139dbd5428e99f00d3ec2..21b594e2725722a4b98bb210331dc73cb68c7bae 100644 --- a/dfall_ws/src/dfall_pkg/include/nodes/CrazyRadioEmulator.h +++ b/dfall_ws/src/dfall_pkg/include/nodes/CrazyRadioEmulator.h @@ -169,8 +169,7 @@ float yaml_cfStateEstimate_polling_period_in_seconds = 0.2f; // A QUADROTORS SIMULATOR -//std::vector<QuadrotorSimulator> m_quadrotor_fleet; -QuadrotorSimulator m_quadrotor_sim(); +QuadrotorSimulator m_quadrotor_sim; diff --git a/dfall_ws/src/dfall_pkg/src/nodes/CrazyRadioEmulator.cpp b/dfall_ws/src/dfall_pkg/src/nodes/CrazyRadioEmulator.cpp index c1b081b8b5c4817803aa4748bfd56f4b73fc19cc..9bad1acfb9b9bc610732b27aad616ef122b3de41 100644 --- a/dfall_ws/src/dfall_pkg/src/nodes/CrazyRadioEmulator.cpp +++ b/dfall_ws/src/dfall_pkg/src/nodes/CrazyRadioEmulator.cpp @@ -548,6 +548,20 @@ int main(int argc, char* argv[]) + // INITIALISE THE QUADROTOR SIMULATOR + // > First conver the agentID to a zero-padded string + // Convert the agent ID to a zero padded string + std::ostringstream str_stream; + str_stream << std::setw(3) << std::setfill('0') << m_agentID; + std::string agentID_as_string(str_stream.str()); + // > Initialise the quadrotor simulator class variable + QuadrotorSimulator m_quadrotor_sim = QuadrotorSimulator( "CFSIM" + agentID_as_string , 0.032 ); + // > Inform the user + ROS_INFO_STREAM("[CRAZY RADIO EMULATOR] Initilised quadrotor simulation with ID = " << m_quadrotor_sim.get_id_string() << ", and mass in kg = " << m_quadrotor_sim.get_mass_in_kg() ); + + + + // PUBLISHERS // Get a node handle to the Flying Agent Client