• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ xmlrpc::XmlRpcValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中xmlrpc::XmlRpcValue的典型用法代码示例。如果您正苦于以下问题:C++ XmlRpcValue类的具体用法?C++ XmlRpcValue怎么用?C++ XmlRpcValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XmlRpcValue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: checkAndSetFeature

  void checkAndSetFeature(CamData& cd, string param_name, dc1394feature_t feature)
  {
    string p = cd.name + string("/") + param_name;
    if (has_param(p))
    {
      XmlRpc::XmlRpcValue val;
      get_param(p, val);
      
      if (val.getType() == XmlRpc::XmlRpcValue::TypeString)
        if (val == string("auto"))
          cd.cam->setFeatureMode(feature, DC1394_FEATURE_MODE_AUTO);
        else 
          cd.cam->setFeatureMode(feature, DC1394_FEATURE_MODE_MANUAL);
          
      
      if (val.getType() == XmlRpc::XmlRpcValue::TypeInt)
      {
        cd.cam->setFeatureMode(feature, DC1394_FEATURE_MODE_MANUAL);
        cd.cam->setFeature(feature, (int)(val));
      }

      if (val.getType() == XmlRpc::XmlRpcValue::TypeDouble)
      {
        cd.cam->setFeatureMode(feature, DC1394_FEATURE_MODE_MANUAL);
        cd.cam->setFeatureAbsolute(feature, (double)(val));
      }
    }
  }
开发者ID:janfrs,项目名称:kwc-ros-pkg,代码行数:28,代码来源:dc1394_cam_server.cpp


示例2: checkAndSetWhitebalance

  void checkAndSetWhitebalance(CamData& cd, string param_name, dc1394feature_t feature)
  {
    string p = cd.name + string("/") + param_name;
    string p_b = cd.name + string("/") + param_name + string("_b");
    string p_r = cd.name + string("/") + param_name + string("_r");

    if (has_param(p_b) && has_param(p_r))
    {
      XmlRpc::XmlRpcValue val;
      XmlRpc::XmlRpcValue val_b;
      XmlRpc::XmlRpcValue val_r;

      get_param(p, val);
      get_param(p_b, val_b);
      get_param(p_r, val_r);
      
      if (val.getType() == XmlRpc::XmlRpcValue::TypeString && val == string("auto"))
        cd.cam->setFeatureMode(feature, DC1394_FEATURE_MODE_AUTO);
      else if (val_b.getType() == XmlRpc::XmlRpcValue::TypeInt && val_r.getType() == XmlRpc::XmlRpcValue::TypeInt)
      {
        cd.cam->setFeatureMode(feature, DC1394_FEATURE_MODE_MANUAL);
        cd.cam->setFeature(feature, (int)(val_b), (int)(val_r));
      }
    }
  }
开发者ID:janfrs,项目名称:kwc-ros-pkg,代码行数:25,代码来源:dc1394_cam_server.cpp


示例3: set

 bool set(std::string key, XmlRpc::XmlRpcValue val)
 {
     try
     {
         if (val.getType() == XmlRpc::XmlRpcValue::TypeBoolean){
             bool value = static_cast<bool>(val);
             return (set(key,value));
         }
         if (val.getType() == XmlRpc::XmlRpcValue::TypeDouble){
             double value = static_cast<double>(val);
             return (set(key,value));
         }
         if (val.getType() == XmlRpc::XmlRpcValue::TypeString){
             std::string value = static_cast<std::string>(val);
             return (set(key,value));
         }
         if (val.getType() == XmlRpc::XmlRpcValue::TypeInt){
             int value = static_cast<int>(val);
             return (set(key,value));
         }
     }
     catch (...)
     {
         return false;
     }
     return false;
 }
开发者ID:LucaGemma87,项目名称:pacman_vision,代码行数:27,代码来源:modules_config.hpp


示例4: get

 bool get(std::string key, XmlRpc::XmlRpcValue& val)
 {
     try
     {
         bool v;
         if (get(key,v)){
             XmlRpc::XmlRpcValue vb(v);
             val = vb;
             return (val.valid());
         }
         double vd;
         if (get(key,vd)){
             val = vd;
             return (val.valid());
         }
         int vi;
         if (get(key,vi)){
             val=vi;
             return (val.valid());
         }
         std::string vs;
         if (get(key, vs)){
             val=vs.c_str();
             return (val.valid());
         }
     }
     catch (...)
     {
         return false;
     }
     return false;
 }
开发者ID:LucaGemma87,项目名称:pacman_vision,代码行数:32,代码来源:modules_config.hpp


示例5: while

Path::Path() {
	ros::NodeHandle nh;
	XmlRpc::XmlRpcValue pathCfg;
	nh.getParam("/path", pathCfg);
	try {
		int i = 0;
		do {
			char pointName[256];
			sprintf(pointName, "point%d", i);
			if (!pathCfg.hasMember(pointName))
				break;

			XmlRpc::XmlRpcValue pointCfg = pathCfg[std::string(pointName)];
			geometry_msgs::Point p;
			if (!(pointCfg.hasMember("x") && pointCfg.hasMember("y")))
				continue;

			p.x = FLOAT_PARAM(pointCfg["x"]);
			p.y = FLOAT_PARAM(pointCfg["y"]);
			p.z = 0;

			points.push_back(p);
		} while ((++i) != 0);
	} catch (XmlRpc::XmlRpcException& e) {
		ROS_ERROR("Unable to parse path parameter. (%s)", e.getMessage().c_str());
	}
}
开发者ID:Niggins,项目名称:COMP3431-Assignment1,代码行数:27,代码来源:path.cpp


示例6: execute

void startWorkingCallback::execute (XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result)
{
    // if no arguments were received
    if (!params.valid())
    {
        result = ctrl_xmlrpc->startProcessing();
    }
    else
    {
        switch(params.size())
        {
        // start the server in online mode with port and blocksize
        case 2:
            ctrl_xmlrpc->startEegServer((int) params[0], (int) params[1]);
            result = 0;
            break;
        case 3:
            ctrl_xmlrpc->startEegServer((std::string) params[0], (int) params[1], (int) params[2]);
            result = 0;
            break;
        default:
            OMG("WARNING! Server got wrong number of arguments!");
            break;
        }
    }
    fflush(stdout);
}
开发者ID:BioinformaticsArchive,项目名称:pyspace,代码行数:27,代码来源:ctrl_xmlrpc.cpp


示例7: getConfigurationFromParameters

void TeleopCOB::getConfigurationFromParameters()
{
	//std::map<std::string,joint_module> joint_modules; //std::vector<std::string> module_names;
	if(n_.hasParam("modules"))
	{
		XmlRpc::XmlRpcValue modules;
		ROS_DEBUG("modules found ");
		n_.getParam("modules", modules);
		if(modules.getType() == XmlRpc::XmlRpcValue::TypeStruct)
		{
			ROS_DEBUG("modules are of type struct with size %d",(int)modules.size());

			for(std::map<std::string,XmlRpc::XmlRpcValue>::iterator p=modules.begin();p!=modules.end();++p)
			{
				std::string mod_name = p->first;
				ROS_DEBUG("module name: %s",mod_name.c_str());
				XmlRpc::XmlRpcValue mod_struct = p->second;
				if(mod_struct.getType() != XmlRpc::XmlRpcValue::TypeStruct)
					ROS_WARN("invalid module, name: %s",mod_name.c_str());
				// search for joint_name parameter in current module struct to determine which type of module
				// only joint mods or wheel mods supported
				// which mens that is no joint names are found, then the module is a wheel module
				// TODO replace with build in find, but could not get it to work
				if(!assign_joint_module(mod_name, mod_struct))
				{
					// add wheel module struct
					ROS_DEBUG("wheel module found");
					assign_base_module(mod_struct);
				}
			}
		}
	}
}
开发者ID:abubeck,项目名称:cob_apps,代码行数:33,代码来源:cob_teleop.cpp


示例8: getImpl

bool getImpl(const std::string& key, int& i, bool use_cache)
{
  XmlRpc::XmlRpcValue v;
  if (!getImpl(key, v, use_cache))
  {
    return false;
  }

  if (v.getType() == XmlRpc::XmlRpcValue::TypeDouble)
  {
    double d = v;

    if (fmod(d, 1.0) < 0.5)
    {
      d = floor(d);
    }
    else
    {
      d = ceil(d);
    }

    i = d;
  }
  else if (v.getType() != XmlRpc::XmlRpcValue::TypeInt)
  {
    return false;
  }
  else
  {
    i = v;
  }

  return true;
}
开发者ID:rosmod,项目名称:rosmod-comm,代码行数:34,代码来源:rosmod_param.cpp


示例9: setParams

bool DepthImageOccupancyMapUpdater::setParams(XmlRpc::XmlRpcValue &params)
{
  try
  {
    sensor_type_ = (std::string) params["sensor_type"];
    if (params.hasMember("image_topic"))
      image_topic_ = (std::string) params["image_topic"];
    if (params.hasMember("queue_size"))
      queue_size_ = (int)params["queue_size"];
    
    readXmlParam(params, "near_clipping_plane_distance", &near_clipping_plane_distance_);
    readXmlParam(params, "far_clipping_plane_distance", &far_clipping_plane_distance_);
    readXmlParam(params, "shadow_threshold", &shadow_threshold_);
    readXmlParam(params, "padding_scale", &padding_scale_);
    readXmlParam(params, "padding_offset", &padding_offset_);
    readXmlParam(params, "skip_vertical_pixels", &skip_vertical_pixels_);
    readXmlParam(params, "skip_horizontal_pixels", &skip_horizontal_pixels_);
  }
  catch (XmlRpc::XmlRpcException &ex)
  {
    ROS_ERROR("XmlRpc Exception: %s", ex.getMessage().c_str());
    return false;
  }
  
  return true;
}
开发者ID:mpomarlan,项目名称:moveit_puzzle_demo,代码行数:26,代码来源:depth_image_occupancy_map_updater.cpp


示例10: setParams

 bool PointCloudMoveitFilter::setParams(XmlRpc::XmlRpcValue &params)
 {
   try
   {
     if (!params.hasMember("point_cloud_topic"))
       return false;
     point_cloud_topic_ = static_cast<const std::string&>(params["point_cloud_topic"]);
     
     readXmlParam(params, "max_range", &max_range_);
     readXmlParam(params, "padding_offset", &padding_);
     readXmlParam(params, "padding_scale", &scale_);
     readXmlParam(params, "point_subsample", &point_subsample_);
     if (!params.hasMember("filtered_cloud_topic")) {
       ROS_ERROR("filtered_cloud_topic is required");
       return false;
     }
     else {
       filtered_cloud_topic_ = static_cast<const std::string&>(params["filtered_cloud_topic"]);
     }
     if (params.hasMember("filtered_cloud_use_color")) {
       use_color_ = (bool)params["filtered_cloud_use_color"];
     }
     if (params.hasMember("filtered_cloud_keep_organized")) {
       keep_organized_ = (bool)params["filtered_cloud_keep_organized"];
     }
   }
   catch (XmlRpc::XmlRpcException& ex)
   {
     ROS_ERROR("XmlRpc Exception: %s", ex.getMessage().c_str());
     return false;
   }
   
   return true;
 }
开发者ID:otsubo,项目名称:jsk_recognition,代码行数:34,代码来源:pointcloud_moveit_filter.cpp


示例11: readPoseParam

void FootstepMarker::readPoseParam(ros::NodeHandle& pnh, const std::string param,
                                   tf::Transform& offset) {
  XmlRpc::XmlRpcValue v;
  geometry_msgs::Pose pose;
  if (pnh.hasParam(param)) {
    pnh.param(param, v, v);
    // check if v is 7 length Array
    if (v.getType() == XmlRpc::XmlRpcValue::TypeArray &&
        v.size() == 7) {
      // safe parameter access by getXMLDoubleValue
      pose.position.x = getXMLDoubleValue(v[0]);
      pose.position.y = getXMLDoubleValue(v[1]);
      pose.position.z = getXMLDoubleValue(v[2]);
      pose.orientation.x = getXMLDoubleValue(v[3]);
      pose.orientation.y = getXMLDoubleValue(v[4]);
      pose.orientation.z = getXMLDoubleValue(v[5]);
      pose.orientation.w = getXMLDoubleValue(v[6]);
      // converst the message as following: msg -> eigen -> tf
      //void poseMsgToEigen(const geometry_msgs::Pose &m, Eigen::Affine3d &e);
      Eigen::Affine3d e;
      tf::poseMsgToEigen(pose, e); // msg -> eigen
      tf::transformEigenToTF(e, offset); // eigen -> tf
    }
    else {
      ROS_ERROR_STREAM(param << " is malformed, which should be 7 length array");
    }
  }
  else {
    ROS_WARN_STREAM("there is no parameter on " << param);
  }
}
开发者ID:DaikiMaekawa,项目名称:jsk_visualization,代码行数:31,代码来源:footstep_marker.cpp


示例12: getNodes

bool getNodes(V_string& nodes)
{
  XmlRpc::XmlRpcValue args, result, payload;
  args[0] = this_node::getName();

  if (!execute("getSystemState", args, result, payload, true))
  {
    return false;
  }

  S_string node_set;
  for (int i = 0; i < payload.size(); ++i)
  {
    for (int j = 0; j < payload[i].size(); ++j)
    {
      XmlRpc::XmlRpcValue val = payload[i][j][1];
      for (int k = 0; k < val.size(); ++k)
      {
        std::string name = payload[i][j][1][k];
        node_set.insert(name);
      }
    }
  }

  nodes.insert(nodes.end(), node_set.begin(), node_set.end());

  return true;
}
开发者ID:1ee7,项目名称:micROS-drt,代码行数:28,代码来源:master.cpp


示例13: getDoubleArray

bool FTParamsInternal::getDoubleArray(XmlRpc::XmlRpcValue params, const char* name, double *results, unsigned len)
{
  if(!params.hasMember(name))
  {
    ROS_ERROR("Expected ft_param to have '%s' element", name);
    return false;
  }

  XmlRpc::XmlRpcValue values = params[name];
  if (values.getType() != XmlRpc::XmlRpcValue::TypeArray)
  {
    ROS_ERROR("Expected FT param '%s' to be list type", name);
    return false;
  }
  if (values.size() != int(len))
  {
    ROS_ERROR("Expected FT param '%s' to have %d elements", name, len);
    return false;
  }
  for (unsigned i=0; i<len; ++i)
  {
    if (values[i].getType() != XmlRpc::XmlRpcValue::TypeDouble)
    {
      ROS_ERROR("Expected FT param %s[%d] to be floating point type", name, i);
      return false;
    } else {
      results[i] = static_cast<double>(values[i]);
    }
  }

  return true;
}
开发者ID:PR2,项目名称:pr2_ethercat_drivers,代码行数:32,代码来源:wg06.cpp


示例14: generateConfigVector

/*generateConfigVector stores the pinging sensors, to which pinging sensor is a listening
 * sensor bound to in a cycle and which sensors are not used at all.
 * In the output, the pinging sensors are represented by PINGING_SENSOR, location of
 * each listening sensor holds the address of its corresponding pinging sensor
 * and the sensors not used at all are represented by SENSOR_NOT_USED.
 */
std::vector <std::vector<int> > generateConfigVector(XmlRpc::XmlRpcValue config_list)
{
	std::vector<std::vector<int> > config;
	XmlRpc::XmlRpcValue current_cycle;
	ROS_ASSERT(config_list.getType() == XmlRpc::XmlRpcValue::TypeArray);

	for(int i = 0; i < config_list.size(); i++)
	{
		ROS_ASSERT(config_list[i].getType() == XmlRpc::XmlRpcValue::TypeStruct);
		std::vector<int> cycle_vector; //For holding configuration for each cycle.
		cycle_vector.resize(MAX_SENSORS);
		for (int j=0; j<MAX_SENSORS; j++)
			cycle_vector[j]=SENSOR_NOT_USED;

		//better to keep it dynamic
		for (int j = 0; j<MAX_SENSORS; j++){
			char str_index[3] = {'\0','\0', '\0'}; // for storing int to hex conv. 
			sprintf(str_index,"%d", j); // Unsure if yamlcpp parser reads hexadecimal values
			if(config_list[i].hasMember(str_index))
			{
				cycle_vector[j]=PINGING_SENSOR; //Set -1 for pinging sensor
				current_cycle = (config_list[i]).operator[](str_index);
				ROS_ASSERT(current_cycle.getType() == XmlRpc::XmlRpcValue::TypeArray);
				ROS_ASSERT(current_cycle.size()>0);
				//Assign address of pinging sensor to each listening sensor
				for (int k = 0; k<current_cycle.size(); k++){
					cycle_vector[static_cast<int>(current_cycle[k])]=((static_cast<int>(current_cycle[k])!=j)?j:PINGING_AND_LISTENING_SENSOR);
				}
			}
		}
		config.push_back(cycle_vector);
	}
	return config;
}
开发者ID:ipa-goa,项目名称:ipa_lcrob,代码行数:40,代码来源:us_driver.cpp


示例15: getProcState

void CRTLXmlrpc::getProcState(XmlRpc::XmlRpcValue& result)
{

    result.setSize(3);
    result[1] = 0.0;
    result[2] = 0.0;

    if(eegmanager == NULL) {
        result[0] = std::string("IDLE");
        return;
    }

    // update local state variable
    if(!eegmanager->isRunning()) started = false;

    if(eegmanager->isRunning()) {
        result.setSize(eegmanager->bandwidth.size()*2 + 1);
        result[0] = std::string("RUNNING");
        result.setSize(eegmanager->bandwidth.size());
        for(uint32_t i=0; i<eegmanager->bandwidth.size(); i++) {
            result[(i*2)+1] = eegmanager->bandwidth[i];
            result[(i*2)+2] = eegmanager->fill[i];
        }
        return;
    }

    if(eegmanager->current_setup().size() > 0) {
        result[0] = std::string("CONFIGURED");
        return;
    }

    result[0] = std::string("IDLE");

    return;
}
开发者ID:BioinformaticsArchive,项目名称:pyspace,代码行数:35,代码来源:ctrl_xmlrpc.cpp


示例16: readDoubleArray

bool TestCollisionWorld::readDoubleArray(XmlRpc::XmlRpcValue& list, std::vector<double>& array)
{
    if (list.getType() != XmlRpc::XmlRpcValue::TypeArray)
    {
        ROS_ERROR("Parameter needs to be an *array* of doubles");
        return false;
    }

    array.clear();
    for (int32_t i = 0; i < list.size(); ++i)
    {
        if (list[i].getType() != XmlRpc::XmlRpcValue::TypeDouble &&
                list[i].getType() != XmlRpc::XmlRpcValue::TypeInt)
        {
            ROS_ERROR("Parameter needs to be an array of *doubles*");
            return false;
        }
        double value=0.0;
        if (list[i].getType() == XmlRpc::XmlRpcValue::TypeInt)
            value = static_cast<double>(static_cast<int>(list[i]));
        else value = static_cast<double>(list[i]);
        array.push_back(value);
    }
    return true;
}
开发者ID:carlos22,项目名称:usc-clmc-ros-pkg,代码行数:25,代码来源:test_collision_world.cpp


示例17: assign_joint_module

/**
 * Tries to read joint module configurations from XmlRpcValue object.
 * If the module is a joint module, it contains a joint name array.
 * A typical joint module has the following configuration structure:
 * struct {
 * 	  joint_names: ['head_pan_joint','head_tilt_joint'],
 * 	  joint_step: 0.075
 * }
 * @param mod_struct configuration object struct
 * @return true if the configuration object hols a joint module config, else false
 */
bool TeleopCOB::assign_joint_module(std::string mod_name, XmlRpc::XmlRpcValue mod_struct)
{
	// search for joint_name parameter in current module struct to determine which type of module
	// only joint mods or wheel mods supported
	// which mens that is no joint names are found, then the module is a wheel module
	// TODO replace with build in find, but could not get it to work
	bool is_joint_module = false;
	joint_module tempModule;
	for(std::map<std::string,XmlRpc::XmlRpcValue>::iterator ps=mod_struct.begin();ps!=mod_struct.end();++ps)
	{
		std::string par_name = ps->first;
		ROS_DEBUG("par name: %s",par_name.c_str());

		if(par_name.compare("joint_names")==0)
		{
			ROS_DEBUG("joint names found");
			XmlRpc::XmlRpcValue joint_names = ps->second;

			ROS_ASSERT(joint_names.getType() == XmlRpc::XmlRpcValue::TypeArray);
			ROS_DEBUG("joint_names.size: %d \n", joint_names.size());
			for(int i=0;i<joint_names.size();i++)
			{
				ROS_ASSERT(joint_names[i].getType() == XmlRpc::XmlRpcValue::TypeString);
				std::string s((std::string)joint_names[i]);
				ROS_DEBUG("joint_name found = %s",s.c_str());
				tempModule.joint_names.push_back(s);
			}
			// set size of other vectors according to the joint name vector
			tempModule.req_joint_pos_.resize(joint_names.size());
			tempModule.req_joint_vel_.resize(joint_names.size());

			is_joint_module = true;
			//break; // no need to continue searching if joint names are found
		}else if(par_name.compare("joint_step")==0){
			ROS_DEBUG("joint steps found");
			XmlRpc::XmlRpcValue joint_steps = ps->second;

			ROS_ASSERT(joint_steps.getType() == XmlRpc::XmlRpcValue::TypeArray);
			ROS_DEBUG("joint_steps.size: %d \n", joint_steps.size());
			for(int i=0;i<joint_steps.size();i++)
			{
				ROS_ASSERT(joint_steps[i].getType() == XmlRpc::XmlRpcValue::TypeDouble);
				double step((double)joint_steps[i]);
				ROS_DEBUG("joint_step found = %f",step);
				tempModule.steps.push_back(step);
			}
		}
	}
	if(is_joint_module)
	{
		// assign publisher
		tempModule.module_publisher_ = n_.advertise<trajectory_msgs::JointTrajectory>(("/"+mod_name+"_controller/command"),1);
		tempModule.module_publisher_brics_ = n_.advertise<brics_actuator::JointVelocities>(("/"+mod_name+"_controller/command_vel"),1);
		// store joint module in collection
		ROS_DEBUG("head module stored");
		joint_modules_.insert(std::pair<std::string,joint_module>(mod_name,tempModule));
	}
	return is_joint_module;
}
开发者ID:abubeck,项目名称:cob_apps,代码行数:70,代码来源:cob_teleop.cpp


示例18: init

bool PTPFollowJointTrajectoryController::init(hardware_interface::PositionJointInterface* hw, ros::NodeHandle &root_nh, ros::NodeHandle& controller_nh)
{
  nh_ = controller_nh;

  // get all joint states from the hardware interface
  const std::vector<std::string>& joint_names = hw->getNames();
  for (unsigned i = 0; i < joint_names.size(); i++)
    ROS_DEBUG_NAMED("PTPFollowJointController", "Got joint %s", joint_names[i].c_str());

  XmlRpc::XmlRpcValue joints;
  if (!controller_nh.getParam("joints", joints))
  {
    ROS_ERROR("No joints array setting");
    return false;
  }
  if (joints.getType() != XmlRpc::XmlRpcValue::TypeArray)
  {
    ROS_ERROR("Joints array setting setting type mismatched");
    return false;
  }

  for (size_t i = 0; i < joints.size(); i++)
  {
    std::string joint_name;
    ROS_ASSERT(joints[i].getType() == XmlRpc::XmlRpcValue::TypeString);
    joint_name = static_cast<std::string>(joints[i]);

    for(size_t j = 0; j < joint_names.size(); j++)
    {
      if(joint_name == joint_names[i])
      {
        ROS_DEBUG("Add joint %s to PTPFollowJointController", joint_name.c_str());
        joints_.push_back(hw->getHandle(joint_name));
        break;
      }
    }
  }

  q.resize(joints_.size());
  qd.resize(joints_.size());
  qdd.resize(joints_.size());

  // Creates a dummy trajectory
  boost::shared_ptr<SpecifiedTrajectory> traj_ptr(new SpecifiedTrajectory(1));
  SpecifiedTrajectory &traj = *traj_ptr;
  traj[0].duration = 0.0;
  traj[0].splines.resize(joints_.size());
  for (size_t j = 0; j < joints_.size(); ++j)
    traj[0].splines[j].coef[0] = 0.0;
  current_trajectory_box_.set(traj_ptr);


  action_server_follow_.reset(new FJTAS(controller_nh, "ptp_follow_joint_trajectory",
                                        boost::bind(&PTPFollowJointTrajectoryController::goalCBFollow, this, _1),
                                        boost::bind(&PTPFollowJointTrajectoryController::cancelCBFollow, this, _1),
                                        false));
  action_server_follow_->start();
  return true;
}
开发者ID:hiveground-ros-package,项目名称:hiveground_controllers,代码行数:59,代码来源:ptp_follow_joint_trajectory_controller.cpp


示例19: main

int main(int argc, char* argv[])
{
    std::vector<ros::Subscriber> subs;

    ros::init(argc, argv, "Navi2");
    ros::NodeHandle nh;
    
    XmlRpc::XmlRpcValue topicList;
    ros::param::get("~inputTopics", topicList);
    
    ROS_ASSERT(topicList.size() > 0);
    ROS_ASSERT(topicList.getType() == XmlRpc::XmlRpcValue::TypeArray);
    
    
    for (int i = 0; i < topicList.size(); ++i) 
    {
        ROS_ASSERT(topicList[i].getType() == XmlRpc::XmlRpcValue::TypeString);
        std::string topic = static_cast<std::string>(topicList[i]);
        
        maps.push_back(nav_msgs::OccupancyGrid());
        flags.push_back(0);
        
        subs.push_back(nh.subscribe<nav_msgs::OccupancyGrid>(topic, 1, boost::bind(mapCallback, _1, i)));
    }
    
    ros::Publisher mapPub = nh.advertise<nav_msgs::OccupancyGrid>("output", 1);
    ros::Rate rate(20);
    
    while (ros::ok())
    {
        rate.sleep();
        ros::spinOnce();
        
        //Everyone ready?
        if ((unsigned int)std::count(flags.begin(), flags.end(), 1) == flags.size())
        {
            //merge
            nav_msgs::OccupancyGrid map;
            
            map.info = maps.front().info;
            
            for (unsigned int i = 0; i < map.info.height * map.info.width; ++i)
            {
                map.data.push_back(-1);
                
                for (std::vector<nav_msgs::OccupancyGrid>::iterator j = maps.begin(); j != maps.end(); ++j)
                {
                    map.data[i] = std::max(map.data[i], j->data[i]);
                }
            }
            
            mapPub.publish(map);
            
            //Make not ready
            std::fill(flags.begin(), flags.end(), 0);
        }
    }
}
开发者ID:UML-Robotics-Club,项目名称:igvc-2012,代码行数:58,代码来源:mapMerger.cpp


示例20: shutdownCallback

// Replacement "shutdown" XMLRPC callback
void shutdownCallback( XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result )
{
	if( (params.getType() == XmlRpc::XmlRpcValue::TypeArray)
			&& (params.size() > 1) ) {
		std::string reason = params[1];
		ROS_WARN( "Shutdown request received. Reason: [%s]", reason.c_str() );
		g_request_shutdown = 1;
	}
	result = ros::xmlrpc::responseInt( 1, "", 0 );
}
开发者ID:AndLydakis,项目名称:Sek_Slam,代码行数:11,代码来源:main.cpp



注:本文中的xmlrpc::XmlRpcValue类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ xmlrpc_c::paramList类代码示例发布时间:2022-05-31
下一篇:
C++ xmlpp::TextReader类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap