本文整理汇总了C++中intrusive_ptr::armMotors方法的典型用法代码示例。如果您正苦于以下问题:C++ intrusive_ptr::armMotors方法的具体用法?C++ intrusive_ptr::armMotors怎么用?C++ intrusive_ptr::armMotors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类intrusive_ptr
的用法示例。
在下文中一共展示了intrusive_ptr::armMotors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_uquad_device
void test_uquad_device(intrusive_ptr<hal::UQuad> const &device)
{
BOOST_TEST_REQUIRE(!device->isOpen());
BOOST_TEST_REQUIRE(!device->open());
BOOST_TEST_REQUIRE(device->isOpen());
BOOST_TEST_REQUIRE(!device->areMotorsRunning());
#if 0
for(int lm = hal::UQuad::kLedMode0; lm < hal::UQuad::kLedModeCount; ++lm)
{
hal::UQuad::eLedMode elm = static_cast<hal::UQuad::eLedMode>(lm);
device->setLedsMode(elm, elm, elm, elm);
::usleep(2000000);
}
#endif
BOOST_TEST_REQUIRE(!device->armMotors());
::usleep(3000000);
BOOST_TEST_REQUIRE(device->areMotorsRunning());
for(int p = 0; p < 50; ++p)
{
float mp = p/50.0f;
device->setMotorsPower(mp, mp, mp, mp);
::usleep(50000);
}
::usleep(2000000);
BOOST_TEST_REQUIRE(!device->disarmMotors());
::usleep(500000);
BOOST_TEST_REQUIRE(!device->areMotorsRunning());
device->setLedsMode(hal::UQuad::kLedMode0, hal::UQuad::kLedMode0, hal::UQuad::kLedMode0, hal::UQuad::kLedMode0);
::usleep(1000000);
BOOST_TEST_REQUIRE(!device->close());
BOOST_TEST_REQUIRE(!device->isOpen());
}