Пример #1
0
		bool initConfiguration() {
			if ( !Kicker::initConfiguration() ) return false;

			try { _preloadDays = configGetDouble("loadEventDB"); }
			catch ( ... ) {}

			try {
				_script0 = Seiscomp::Environment::Instance()->absolutePath(configGetString("scripts.script0"));
			}
			catch ( ... ) {}

			try {
				_scriptStyle0 = configGetBool("scripts.script0.oldStyle");
			}
			catch ( ... ) {
				_scriptStyle0 = true;
			}

			try {
				_script1 = Seiscomp::Environment::Instance()->absolutePath(configGetString("scripts.script1"));
			}
			catch ( ... ) {}

			try {
				_scriptStyle1 = configGetBool("scripts.script1.oldStyle");
			}
			catch ( ... ) {
				_scriptStyle1 = true;
			}

			return true;
		}
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void Monitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	//Read params from config file
	RoboCompCommonBehavior::Parameter aux;
	aux.editable = false;
	aux.type = "string";
	configGetString( "V4linux.Device", aux.value,"/dev/video0");
	params["V4linux.Device"] = aux;
	configGetString("V4linux.captureMode",aux.value,"YUV422Mode");
	params["V4linux.captureMode"] = aux;	
	
	aux.type = "int";
	configGetString("V4linux.NumCameras",aux.value,"1");
	params["V4linux.NumCameras"] = aux;
	configGetString("V4linux.Width",aux.value,"320");
	params["V4linux.Width"] = aux;
	configGetString("V4linux.Height",aux.value,"240");
	params["V4linux.Height"] = aux;
	configGetString("V4linux.FPS",aux.value,"15");
	params["V4linux.FPS"] = aux;
	
	aux.type = "bool";
	configGetString("V4linux.TalkToBase",aux.value,"true");
	params["V4linux.TalkToBaseComp"] = aux;
	configGetString("V4linux.TalkToCommonHead",aux.value,"true");
	params["V4linux.TalkToCommonHead"] = aux;
	
	int num_cameras = QString::fromStdString(params["V4linux.NumCameras"].value).toInt();
	for(int i=0;i < num_cameras; i++)
	{
		std::string s= QString::number(i).toStdString();
		configGetString( "V4linux.Params_" + s, aux.value , "");
		params["V4linux.Params_" + s] = aux;
		QStringList list = QString::fromStdString(aux.value).split(",");
		if (list.size() != 8) qFatal("Error reading camera. Only %d parameters for camera %d, 7 needed.", list.size(), i);
		
		aux.type = "string";
		aux.value=list[0].toStdString();
		params["V4linux.Params_" + s +".name"]= aux;
		aux.value=list[1].toStdString();
		params["V4linux.Params_" + s +".busId"]= aux;
		aux.value=list[2].toStdString();
		aux.type = "bool";
		params["V4linux.Params_" + s +".invertedH"]= aux;
		aux.value=list[3].toStdString();
		params["V4linux.Params_" + s +".invertedV"]= aux;
		aux.value=list[4].toStdString();
		aux.type = "int";
		params["V4linux.Params_" + s +".focalX"]= aux;
		aux.value=list[5].toStdString();
		params["V4linux.Params_" + s +".focalY"]= aux;
		aux.value=list[6].toStdString();
		params["V4linux.Params_" + s +".saturation"]= aux;
		aux.value=list[7].toStdString();	
		params["V4linux.Params_" + s +".linefreq"]= aux;
	}
	    
}
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void SpecificMonitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	RoboCompCommonBehavior::Parameter aux;
	aux.editable = true;
	configGetString( "InputInterface", aux.value,"Camera");  //Could be RGBD, RGBDBus
	params["InputInterface"] = aux;
	
	aux.editable = false;
	configGetString( "AprilTagsFamily", aux.value,"tagCodes36h11"); 
	params["AprilTagsFamily"] = aux;
	
	aux.editable = false;
	configGetString("AprilTagsSize", aux.value,"70");	params["AprilTagsSize"] = aux;
	
	aux.editable = false;
	configGetString("ID:0-10", aux.value,"86");
	params["ID:0-10"] = aux;
	
	aux.editable = false;
	configGetString("ID:11-20", aux.value,"86");
	params["ID:11-20"] = aux;

	aux.editable = false;
	configGetString("ID:21-100", aux.value,"86");
	params["ID:21-100"] = aux;

	aux.editable = true;
	configGetString( "CameraName", aux.value, "rgbd");
	params["CameraName"] = aux;
	
	aux.editable = true;
	configGetString( "InnerModelPath", aux.value, "");
	params["InnerModelPath"] = aux;
}
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void SpecificMonitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	//Read params from config file
	//Example
	RoboCompCommonBehavior::Parameter aux;
	aux.editable = false;
	configGetString( "joystickUniversal.Device", aux.value,"/dev/input/js0");
	params["joystickUniversal.Device"] = aux;
	
	aux.editable = false;
	configGetString( "joystickUniversal.NumAxes", aux.value,"2");
	params["joystickUniversal.NumAxes"] = aux;
	
	aux.editable = false;
	configGetString( "joystickUniversal.NumButtons", aux.value,"1");
	params["joystickUniversal.NumButtons"] = aux;
	
	aux.editable = false;
	configGetString( "joystickUniversal.BasicPeriod", aux.value,"100");
	params["joystickUniversal.BasicPeriod"] = aux;
	
	aux.editable = false;
	configGetString( "joystickUniversal.NormalizationValue", aux.value,"10");
	params["joystickUniversal.NormalizationValue"] = aux;
	
	aux.editable = false;
	configGetString( "joystickUniversal.VelocityAxis", aux.value,"vel");
	params["joystickUniversal.VelocityAxis"] = aux;
	
	aux.editable = false;
	configGetString( "joystickUniversal.DirectionAxis", aux.value,"dir");
	params["joystickUniversal.DirectionAxis"] = aux;
	
	for (int i=0; i < atoi(params.at("joystickUniversal.NumAxes").value.c_str()); i++)
	{
		aux.editable = false;
		std::string s = QString::number(i).toStdString();
		configGetString( "joystickUniversal.Axis_" + s, aux.value , "4");
		params["joystickUniversal.Axis_" + s] = aux;
		rDebug("joystickUniversal.Axis_"+QString::fromStdString(s)+" = " + QString::fromStdString(params.at("joystickUniversal.Axis_" + s).value));
		QStringList list = QString::fromStdString(aux.value).split(",");
		if (list.size() != 4)	
			qFatal("joystickUniversalComp::Monitor::readConfig(): ERROR reading axis. Only %d parameters for motor %d.", list.size(), i);
		
		aux.value=list[0].toStdString();
		params["joystickUniversal.Axis_" + s +".Name"] = aux;
		rDebug("joystickUniversal.Axis_" + s + ".Name = " + params.at("joystickUniversal.Axis_" + s +".Name").value);
		aux.value=list[1].toStdString();
		params["joystickUniversal.Axis_" + s +".MinRange"]= aux;
		rDebug("joystickUniversal.Axis_"+s+".MinRange = "+ params["joystickUniversal.Axis_" + s +".MinRange"].value);
		aux.value=list[2].toStdString();
		params["joystickUniversal.Axis_" + s +".MaxRange"]= aux;
		rDebug("joystickUniversal.Axis_"+s+".MaxRange = "+ params["joystickUniversal.Axis_" + s +".MaxRange"].value);
		aux.value=list[3].toStdString();
		params["joystickUniversal.Axis_" + s +".Inverted"]= aux;
		rDebug("joystickUniversal.Axis_"+s+".Inverted = "+ params["joystickUniversal.Axis_" + s +".Inverted"].value);

	}
}
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void SpecificMonitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	RoboCompCommonBehavior::Parameter aux;
	aux.editable = true;

	configGetString("", "InnerModel", aux.value,"");
	params["InnerModel"] = aux;
}
Пример #6
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Import::init() {
	if (!Application::init())
		return false;

	if ( !Filter::Init(*this) ) return false;

	if (commandline().hasOption("test"))
		_test = true;

	if (commandline().hasOption("no-filter"))
		_filter = false;

	if (commandline().hasOption("import"))
		_mode = IMPORT;

	if (commandline().hasOption("routeunknowngroup"))
		_routeUnknownGroup = true;

	if (commandline().hasOption("ignore-groups"))
		_useSpecifiedGroups = false;

	try {
		configGetString("routingtable");
		_mode = IMPORT;
	}
	catch ( ... ) {}

	std::string sinkName = "localhost";
	if (commandline().hasOption("sink")) {
		sinkName = commandline().option<std::string>("sink");
	}
	else {
		try {
		sinkName = configGetString("sink");
		}
		catch (Config::Exception& ) {}
	}

	if (connectToSink(sinkName) != Core::Status::SEISCOMP_SUCCESS)
		return false;

	return true;
}
Пример #7
0
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void SpecificMonitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	RoboCompCommonBehavior::Parameter aux;
	aux.editable = true;
	string name = PROGRAM_NAME;

	configGetString("", "InnerModel", aux.value, "");
	printf("XXXXX %s\n", aux.value.c_str());
	params["InnerModel"] = aux;
}
Пример #8
0
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void SpecificMonitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	RoboCompCommonBehavior::Parameter aux;
	aux.editable = true;

	configGetString( "InnerModel", aux.value," ");
	params["InnerModel"] = aux;

	configGetString( "ExclusionList", aux.value," ");
	params["ExclusionList"] = aux;
	
	configGetString( "RestrictedBoundingBoxes", aux.value," ");
	params["RestrictedBoundingBoxes"] = aux;
	
	configGetString( "knownPositions", aux.value," ");
	params["knownPositions"] = aux;
	
	configGetString( "knownTransitions", aux.value," ");
	params["knownTransitions"] = aux;
}
Пример #9
0
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void Monitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	RoboCompCommonBehavior::Parameter aux;
	aux.editable = true;
	configGetString( "Dynamixel.NumMotors", aux.value, "" );	
	int num_motors=0;
	num_motors = QString::fromStdString(aux.value).toInt();
	if(num_motors <= 0) 
	  qFatal("Monitor::initialize - Zero motors found. Exiting..." );

	params["Dynamixel.NumMotors"] = aux;
	configGetString( "Dynamixel.Device", aux.value, "" );	
	params["Dynamixel.Device"] = aux;
	
	configGetString( "Dynamixel.BaudRate", aux.value, "115200" );
	params["Dynamixel.BaudRate"] = aux;
	
	configGetString( "Dynamixel.BasicPeriod", aux.value, "100" );
	params["Dynamixel.BasicPeriod"] = aux;

	configGetString( "Dynamixel.SDK", aux.value, "false" );
	params["Dynamixel.SDK"] = aux;
	
	std::string paramsStr;
	for (int i=0; i<num_motors; i++)
	{
		std::string s= QString::number(i).toStdString();
		configGetString( "Dynamixel.Params_" + s, aux.value , "");
		params["Dynamixel.Params_" + s] = aux;
		QStringList list = QString::fromStdString(aux.value).split(",");
		if (list.size() < 9) qFatal("Error reading motor. Only %d parameters for motor %d. Expecting 9.", list.size(), i);
		else if (list.size() > 9) qFatal("Error reading motor. More than 9 (%d) parameters for motor %d.", list.size(), i);
		aux.value=list[0].toStdString();
		params["Dynamixel.Params_" + s +".name"]= aux;
		aux.value=list[1].toStdString();
		params["Dynamixel.Params_" + s +".busId"]= aux;
		aux.value=list[2].toStdString();
		params["Dynamixel.Params_" + s +".invertedSign"]= aux;
		aux.value=list[3].toStdString();
		params["Dynamixel.Params_" + s +".minPos"]= aux;
		aux.value=list[4].toStdString();
		params["Dynamixel.Params_" + s +".maxPos"]= aux;
		aux.value=list[5].toStdString();
		params["Dynamixel.Params_" + s +".zeroPos"]= aux;
		aux.value=list[6].toStdString();	
		params["Dynamixel.Params_" + s +".maxVelocity"]= aux;
		aux.value=list[7].toStdString();	
		params["Dynamixel.Params_" + s +".stepsRange"]= aux;
		aux.value=list[8].toStdString();	
		params["Dynamixel.Params_" + s +".maxDegrees"]= aux;
	}
}
Пример #10
0
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void SpecificMonitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	
	RoboCompCommonBehavior::Parameter aux;
 	aux.editable = true;
 	string name = PROGRAM_NAME;
 	
	configGetString("", name + ".InnerModel", aux.value, "simpleworld.xml");
	//qDebug() << QString::fromStdString(aux.value);
	
	//Check valid ranges
	if( QFile::exists(QString::fromStdString(aux.value)) == false )
	{
		std::cout << __FUNCTION__ << "Fatal. InnerModel file "<< aux.value << " does not exist" << std::endl;
		qFatal("Aborting");
	}
	
 	params[name+".InnerModel"] = aux;
}
/**
* \brief Read parameters from pconf file. This method will be empty if there is not any pconf file available.
* @param l Configuration parameters list
*/
void GenericMonitor::readPConfParams(RoboCompCommonBehavior::ParameterList &params)
{
	RoboCompCommonBehavior::Parameter aux;
	configGetString( "device", aux.value, "192.168.187.204" );
	params["device"] = aux;
	configGetString( "startValue", aux.value, "0" );
	params["startValue"] = aux;
	configGetString( "endValue", aux.value, "359" );
	params["endValue"] = aux;
	configGetString( "sampleRate", aux.value, "100" );
	params["sampleRate"] = aux;
	configGetString( "angleRes",aux.value,"1");
	params["angleRes"] = aux;
	configGetString( "skipValue", aux.value, "1" );
	params["skipValue"] = aux;
	configGetString( "talkToBase", aux.value, "true" );
	params["talkToBase"] = aux;

}
Пример #12
0
int Hdf::compare(const std::string &v2) const {
  std::string v1 = configGetString();
  return strcmp(v1.c_str(), v2.c_str());
}
Пример #13
0
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void SpecificMonitor::readConfig(RoboCompCommonBehavior::ParameterList &params )
{
	RoboCompCommonBehavior::Parameter aux;
	aux.editable = true;
	configGetString("", "GMapping.maxUrange", aux.value,"20.0");
	params["GMapping.maxUrange"] = aux;
	configGetString("", "GMapping.maxrange", aux.value,"30.0");
	params["GMapping.maxrange"] = aux;
// 	configGetString("", "GMapping.sigma", aux.value,"0.1");
	configGetString("", "GMapping.sigma", aux.value,"0.05");
	params["GMapping.sigma"] = aux;
	configGetString("", "GMapping.regscore", aux.value,"10000.0");
	params["GMapping.regscore"] = aux;
	configGetString("", "GMapping.kernelSize", aux.value,"1");
	params["GMapping.kernelSize"] = aux;
	configGetString("", "GMapping.lstep", aux.value,"0.05");
	params["GMapping.lstep"] = aux;
	configGetString("", "GMapping.astep", aux.value,"0.05");
	params["GMapping.astep"] = aux;
	configGetString("", "GMapping.maxMove", aux.value,"1");
	params["GMapping.maxMove"] = aux;
	configGetString("", "GMapping.iterations", aux.value,"10");
// 	configGetString("", "GMapping.iterations", aux.value,"5");
	params["GMapping.iterations"] = aux;
	configGetString("", "GMapping.lsigma", aux.value,"0.075");
// 	configGetString("", "GMapping.lsigma", aux.value,"0.75");
	params["GMapping.lsigma"] = aux;
	configGetString("", "GMapping.ogain", aux.value,"3");
	params["GMapping.ogain"] = aux;
	configGetString("", "GMapping.lskip", aux.value,"0");
	params["GMapping.lskip"] = aux;
	configGetString("", "GMapping.srr", aux.value,"0.1");
// 	configGetString("", "GMapping.srr", aux.value,"0.01");
	params["GMapping.srr"] = aux;
	configGetString("", "GMapping.srt", aux.value,"0.01");
	params["GMapping.srt"] = aux;
// 	configGetString("", "GMapping.str", aux.value,"0.01");
	configGetString("", "GMapping.str", aux.value,"0.1");
	params["GMapping.str"] = aux;
	configGetString("", "GMapping.stt", aux.value,"0.01");
	params["GMapping.stt"] = aux;
	configGetString("", "GMapping.linearUpdate", aux.value,"0.2");//"0.3");
	params["GMapping.linearUpdate"] = aux;
	configGetString("", "GMapping.angularUpdate", aux.value,"0.1");//"0.1");
	params["GMapping.angularUpdate"] = aux;
	configGetString("", "GMapping.resampleThreshold", aux.value,"0.5");
	params["GMapping.resampleThreshold"] = aux;
	configGetString("", "GMapping.xmin", aux.value,"-20.0");
	params["GMapping.xmin"] = aux;
	configGetString("", "GMapping.xmax", aux.value,"20.0");
	params["GMapping.xmax"] = aux;
	configGetString("", "GMapping.ymin", aux.value,"-20.0");
	params["GMapping.ymin"] = aux;
	configGetString("", "GMapping.ymax", aux.value,"20.0");
	params["GMapping.ymax"] = aux;
	configGetString("", "GMapping.particles", aux.value,"50");
	params["GMapping.particles"] = aux;
	printf("PARTICLES: %s\n", aux.value.c_str());
	
	configGetString("", "GMapping.delta", aux.value,"0.05");
	params["GMapping.delta"] = aux;
	configGetString("", "GMapping.llsamplerange", aux.value,"0.1");
	params["GMapping.llsamplerange"] = aux;
	configGetString("", "GMapping.llsamplestep", aux.value,"0.1");
	params["GMapping.llsamplestep"] = aux;
	configGetString("", "GMapping.lasamplerange", aux.value,"0.01");
	params["GMapping.lasamplerange"] = aux;
	configGetString("", "GMapping.lasamplestep", aux.value,"0.02");
	params["GMapping.llsamplestep"] = aux;
	configGetString("", "GMapping.enlargestep", aux.value,"1");
	params["GMapping.enlargestep"] = aux;
	
	
	
	configGetString("", "GMapping.generateMap", aux.value, "true");
	params["GMapping.generateMap"] = aux;


	try{
		configGetString("", "GMapping.Map", aux.value, "");
	} catch(...)
	{
		aux.value = "";
	}
	params["GMapping.Map"] = aux;

	
	configGetString("", "GMapping.tx", aux.value,"0");
	params["GMapping.tx"] = aux;
	configGetString("", "GMapping.tz", aux.value,"0");
	params["GMapping.tz"] = aux;
	configGetString("", "GMapping.ry", aux.value,"0");
	params["GMapping.ry"] = aux;

	
}
///Local Component parameters read at start
///Reading parameters from config file or passed in command line, with Ice machinery
///We need to supply a list of accepted values to each call
void SpecificMonitor::readConfig(RoboCompCommonBehavior::ParameterList& params )
{
	RoboCompCommonBehavior::Parameter aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","InnerModel", aux.value,"/home/robocomp/robocomp/components/robocomp-ursus-rockin/files/RoCKIn@home/world/rockinSimple.xml");
	params["InnerModel"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","ArrivalTolerance", aux.value,"20");
	params["ArrivalTolerance"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","MaxZSpeed", aux.value,"400");
	params["MaxZSpeed"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","MaxXSpeed", aux.value,"200");
	params["MaxXSpeed"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","MaxRotationSpeed", aux.value,"0.3");
	params["MaxRotationSpeed"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","RobotXWidth", aux.value,"500");
	params["RobotXWidth"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","RobotZLong", aux.value,"500");
	params["RobotZLong"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","RobotRadius", aux.value,"300");
	params["RobotRadius"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","MinControllerPeriod", aux.value,"100");
	params["MinControllerPeriod"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","PlannerGraphPoints", aux.value,"100");
	params["PlannerGraphPoints"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","PlannerGraphNeighbours", aux.value,"20");
	params["PlannerGraphNeighbours"] = aux;

	aux.editable = false;
	configGetString( "TrajectoryRobot2D","PlannerGraphMaxDistanceToSearch", aux.value,"2500");
	params["PlannerGraphMaxDistanceToSearch"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","OuterRegionLeft", aux.value,"0");
	params["OuterRegionLeft"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","OuterRegionRight", aux.value,"6000");
	params["OuterRegionRight"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","OuterRegionBottom", aux.value,"-4250");
	params["OuterRegionBottom"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","OuterRegionTop", aux.value,"4250");
	params["OuterRegionTop"] = aux;
	
	aux.editable = false;
	configGetString( "TrajectoryRobot2D","ExcludedObjectsInCollisionCheck", aux.value,"floor_plane");
	params["ExcludedObjectsInCollisionCheck"] = aux;
}