Пример #1
0
void *MainWindow::CMDGetterEntry(void *a)
{
  MainWindow* main = (MainWindow*)a;
  CMDDATA cmddata;
  long long int tstamp;
  long long int interval;

  while(1){

    // get commands from ROS.
    Getter(cmddata);

    // get time in milliseconds.
    tstamp = (long long int) getTime();

    // update robocar state.
    Update(main);

    // set mode and gear.
    SetState(cmddata.mode, cmddata.gear, main);

    if (!mode_is_setting && !gear_is_setting) {
#ifdef DIRECT_CONTROL
      // directly set accel, brake, and steer.
      Direct(cmddata.accel, cmddata.brake, cmddata.steer, main);
#else
      // control accel, brake, and steer.
      Control(cmddata.vel, main);
#endif
    }

    // get interval in milliseconds.
    interval = cmd_rx_interval - (getTime() - tstamp);

    if (interval > 0) {
      cout << "sleeping for " << interval << "ms" << endl;
      usleep(interval * 1000); // not really real-time...
    }
  }
  return NULL;
}
Пример #2
0
void Properties::GetString(const ValueList& args, KValueRef result)
{
    args.VerifyException("getString", "s");
    Getter(args, result, String);
}
Пример #3
0
void Properties::GetInt(const ValueList& args, KValueRef result)
{
    args.VerifyException("getInt", "s");
    Getter(args, result, Int);
}
Пример #4
0
void Properties::GetDouble(const ValueList& args, KValueRef result)
{
    args.VerifyException("getDouble", "s");
    Getter(args, result, Double);
}
Пример #5
0
void Properties::GetBool(const ValueList& args, KValueRef result)
{
    args.VerifyException("getBool", "s");
    Getter(args, result, Bool);
}
	void PropertiesBinding::GetString(const ValueList& args, KValueRef result)
	{
		Getter(args, result, String);
	}
Пример #7
0
 static uint64_t call_function(const T& Getter)
 {
     LARGE_INTEGER Value;
     Getter(&Value);
     return Value.QuadPart;
 };
	void PropertiesBinding::GetInt(const ValueList& args, KValueRef result)
	{
		Getter(args, result, Int);
	}
	void PropertiesBinding::GetDouble(const ValueList& args, KValueRef result)
	{
		Getter(args, result, Double);
	}
	void PropertiesBinding::GetBool(const ValueList& args, KValueRef result)
	{
		Getter(args, result, Bool);
	}
Пример #11
0
 UnsafeProperty(AutoAnyReference defaultValue, Getter getter = Getter(), Setter setter = Setter(),
                SignalBase::OnSubscribers onsubscribe = SignalBase::OnSubscribers())
   : PropertyImpl<T>(std::move(defaultValue), std::move(getter), std::move(setter), std::move(onsubscribe))
 {}
Пример #12
0
 UnsafeProperty(Getter getter = Getter(), Setter setter = Setter(),
                SignalBase::OnSubscribers onsubscribe = SignalBase::OnSubscribers())
   : PropertyImpl<T>(std::move(getter), std::move(setter), std::move(onsubscribe))
 {}