当前位置: 首页>>代码示例>>C++>>正文


C++ Environment::addDrone方法代码示例

本文整理汇总了C++中Environment::addDrone方法的典型用法代码示例。如果您正苦于以下问题:C++ Environment::addDrone方法的具体用法?C++ Environment::addDrone怎么用?C++ Environment::addDrone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Environment的用法示例。


在下文中一共展示了Environment::addDrone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argv, char* argc[]){
	(void)argv;
	(void)argc;

	//create the sensor map and optionally add in some data
	std::map<std::string, data_type>* sensor_map = new std::map<std::string, data_type>;
	//data_type* sensor_data = new data_type();
	//sensor_map.insert(std::pair<std::string, int>("blank", sensor_data));

	//create the environment and comm module
	Environment* env = new Environment(*sensor_map, 1.0, false);
	std::atomic_flag stdout_lock = ATOMIC_FLAG_INIT;

	CommMod* comm_basic1 = new Basic(env, &stdout_lock);
	CommMod* comm_basic2 = new Basic(env, &stdout_lock);
	CommMod* comm_dummy = new Dummy_comm(env);

	//create and add drones
	BasicTest* drone1 = new BasicTest(comm_basic1, 0.0, 0.0, 0.0, 0.0, env, false);
	BasicTest* drone2 = new BasicTest(comm_basic2, 1.0, 1.0, 0.0, 0.0, env, true);
	Dummy_program* base = new Dummy_program(comm_dummy, 0.0, 0.0, 0.0);
	env->addDrone(drone1);
	env->addDrone(drone2);
	env->setBaseStation(base);

	//run the simulation
	env->run();
}
开发者ID:mcnutty26,项目名称:octoDrone,代码行数:28,代码来源:BasicTestSim.cpp

示例2: main

int main(int argv, char* argc[]){
	(void)argv;
	(void)argc;
	
	//create the sensor map and optionally add in some data
	std::map<std::string, data_type>* sensor_map = new std::map<std::string, data_type>;

	//create the environment and comm module
	Environment* env = new Environment(*sensor_map, "10.0.0.2");
	std::atomic_flag stdout_lock = ATOMIC_FLAG_INIT;

	CommMod* comm_basic = new Basic(env, &stdout_lock);
	CommMod* comm_dummy = new Dummy_comm(env);

	//create and add drones
	Dummy_program* base = new Dummy_program(comm_dummy, 0.0, 0.0, 0.0);
	TakeOff* drone1 = new TakeOff(comm_basic, 0.0, 0.0, 0.0, 1.0, env, true);
	env->addDrone(drone1);
	env->setBaseStation(base);

	//run the simulation
	env->run();
}
开发者ID:mcnutty26,项目名称:octoDrone,代码行数:23,代码来源:TODa.cpp


注:本文中的Environment::addDrone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。