Beispiel #1
0
    //! Constructor.
    BasicRemoteOperation::BasicRemoteOperation(const std::string& name, Tasks::Context& ctx):
      Tasks::Periodic(name, ctx),
      m_connection(false),
      m_connection_timeout(1.0),
      m_last_action(-1.0),
      m_scope_ref(0)
    {
      // Define configuration parameters.
      paramActive(Tasks::Parameter::SCOPE_MANEUVER,
                  Tasks::Parameter::VISIBILITY_DEVELOPER,
                  false);

      param("Connection Timeout", m_connection_timeout)
      .defaultValue("1.0")
      .units(Units::Second);

      addActionButton("Exit");

      m_actions.op = IMC::RemoteActionsRequest::OP_REPORT;

      // Register handler routines.
      bind<IMC::Teleoperation>(this);
      bind<IMC::RemoteActions>(this);
      bind<IMC::RemoteActionsRequest>(this);
      bind<IMC::ControlLoops>(this);
    }
Beispiel #2
0
      Task(const std::string& name, Tasks::Context& ctx):
        Tasks::Task(name, ctx),
        m_origin(NULL),
        m_lbl_cfg(NULL),
        m_prng(NULL)
      {
        // Define configuration parameters.
        paramActive(Tasks::Parameter::SCOPE_MANEUVER,
                    Tasks::Parameter::VISIBILITY_USER,
                    true);

        param("Ping Delay", m_args.ping_delay)
        .units(Units::Second)
        .defaultValue("1.0")
        .description("");

        param("Bad Range Probability", m_args.bad_range_prob)
        .units(Units::Percentage)
        .minimumValue("0")
        .maximumValue("100")
        .defaultValue("5.0")
        .description("Probability of a bad range");

        param("Standard Deviation", m_args.sigma)
        .units(Units::Meter)
        .defaultValue("1.25")
        .description("Standard deviation of \"good\" range. "
                     "It is assumed that range errors are Gaussian distributed "
                     "with mean 0 and std. dev. sigma. "
                     "Rule of thumb (the usual one): to achieve 95% of range errors "
                     "with absolute value less than E, set sigma = E / 2. "
                     "For 99% of errors lower than E set sigma = E / 3");

        param("PRNG Type", m_args.prng_type)
        .defaultValue(Random::Factory::c_default);

        param("PRNG Seed", m_args.prng_seed)
        .defaultValue("-1");

        setEntityState(IMC::EntityState::ESTA_BOOT, Status::CODE_WAIT_GPS_FIX);
        requestDeactivation();

        // Register consumers.
        bind<IMC::LblConfig>(this);
        bind<IMC::GpsFix>(this);
        bind<IMC::SimulatedState>(this);
      }
Beispiel #3
0
      Task(const std::string& name, Tasks::Context& ctx):
        Tasks::Task(name, ctx),
        m_prng(NULL)
      {
        paramActive(Tasks::Parameter::SCOPE_IDLE,
                    Tasks::Parameter::VISIBILITY_USER);

        // Retrieve configuration values
        param("Standard Deviation - Euler Angles", m_args.stdev_euler)
        .units(Units::Degree)
        .defaultValue("0.3")
        .description("White noise added to angular readings");

        param("Standard Deviation - Angular Velocity", m_args.stdev_agvel)
        .units(Units::DegreePerSecond)
        .defaultValue("0.03")
        .description("White noise added to angular velocity readings");

        param("Standard Deviation - Heading Offset", m_args.stdev_heading_offset)
        .units(Units::Degree)
        .defaultValue("0.0")
        .description("Heading bias from the compass");

        param("Gyro Rate Bias", m_args.gyro_bias)
        .units(Units::Degree)
        .defaultValue("1.0")
        .description("Gyro rate bias from the IMU");

        param("Measures Euler Angles", m_args.euler)
        .defaultValue("true")
        .description("Some IMUs do not output Euler Angles measurements");

        param("Activation Control", m_args.activation_control)
        .defaultValue("false")
        .description("True if it is possible to actively control the device");

        param("PRNG Type", m_args.prng_type)
        .defaultValue(Random::Factory::c_default);

        param("PRNG Seed", m_args.prng_seed)
        .defaultValue("-1");

        // Register consumers.
        bind<IMC::SimulatedState>(this);
      }