Example #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;
}
Example #2
0
void Properties::GetString(const ValueList& args, KValueRef result)
{
    args.VerifyException("getString", "s");
    Getter(args, result, String);
}
Example #3
0
void Properties::GetInt(const ValueList& args, KValueRef result)
{
    args.VerifyException("getInt", "s");
    Getter(args, result, Int);
}
Example #4
0
void Properties::GetDouble(const ValueList& args, KValueRef result)
{
    args.VerifyException("getDouble", "s");
    Getter(args, result, Double);
}
Example #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);
	}
 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);
	}
Example #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))
 {}
Example #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))
 {}