本文整理汇总了C++中dynamic_reconfigure::Server类的典型用法代码示例。如果您正苦于以下问题:C++ Server类的具体用法?C++ Server怎么用?C++ Server使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Server类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onInit
virtual void onInit()
{
nh_ = getNodeHandle();
it_ = boost::shared_ptr<image_transport::ImageTransport>(new image_transport::ImageTransport(nh_));
local_nh_ = ros::NodeHandle("~");
local_nh_.param("debug_view", debug_view_, false);
subscriber_count_ = 0;
prev_stamp_ = ros::Time(0, 0);
window_name_ = "Hough Circle Detection Demo";
canny_threshold_initial_value_ = 200;
accumulator_threshold_initial_value_ = 50;
max_accumulator_threshold_ = 200;
max_canny_threshold_ = 255;
//declare and initialize both parameters that are subjects to change
canny_threshold_ = canny_threshold_initial_value_;
accumulator_threshold_ = accumulator_threshold_initial_value_;
image_transport::SubscriberStatusCallback img_connect_cb = boost::bind(&HoughCirclesNodelet::img_connectCb, this, _1);
image_transport::SubscriberStatusCallback img_disconnect_cb = boost::bind(&HoughCirclesNodelet::img_disconnectCb, this, _1);
ros::SubscriberStatusCallback msg_connect_cb = boost::bind(&HoughCirclesNodelet::msg_connectCb, this, _1);
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&HoughCirclesNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::CircleArrayStamped>("circles", 1, msg_connect_cb, msg_disconnect_cb);
if( debug_view_ ) {
subscriber_count_++;
}
dynamic_reconfigure::Server<hough_circles::HoughCirclesConfig>::CallbackType f =
boost::bind(&HoughCirclesNodelet::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
}
示例2: onInit
virtual void onInit()
{
nh_ = getNodeHandle();
it_ = boost::shared_ptr<image_transport::ImageTransport>(new image_transport::ImageTransport(nh_));
local_nh_ = ros::NodeHandle("~");
local_nh_.param("debug_view", debug_view_, false);
subscriber_count_ = 0;
prev_stamp_ = ros::Time(0, 0);
window_name_ = "Hough Lines Demo";
min_threshold_ = 50;
max_threshold_ = 150;
threshold_ = max_threshold_;
image_transport::SubscriberStatusCallback img_connect_cb = boost::bind(&HoughLinesNodelet::img_connectCb, this, _1);
image_transport::SubscriberStatusCallback img_disconnect_cb = boost::bind(&HoughLinesNodelet::img_disconnectCb, this, _1);
ros::SubscriberStatusCallback msg_connect_cb = boost::bind(&HoughLinesNodelet::msg_connectCb, this, _1);
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&HoughLinesNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::LineArrayStamped>("lines", 1, msg_connect_cb, msg_disconnect_cb);
if( debug_view_ ) {
subscriber_count_++;
}
dynamic_reconfigure::Server<hough_lines::HoughLinesConfig>::CallbackType f =
boost::bind(&HoughLinesNodelet::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
}
示例3: onInit
virtual void onInit()
{
nh_ = getNodeHandle();
it_ = boost::shared_ptr<image_transport::ImageTransport>(new image_transport::ImageTransport(nh_));
local_nh_ = ros::NodeHandle("~");
local_nh_.param("debug_view", debug_view_, false);
subscriber_count_ = 0;
prev_stamp_ = ros::Time(0, 0);
image_transport::SubscriberStatusCallback img_connect_cb = boost::bind(&FaceDetectionNodelet::img_connectCb, this, _1);
image_transport::SubscriberStatusCallback img_disconnect_cb = boost::bind(&FaceDetectionNodelet::img_disconnectCb, this, _1);
ros::SubscriberStatusCallback msg_connect_cb = boost::bind(&FaceDetectionNodelet::msg_connectCb, this, _1);
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&FaceDetectionNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::FaceArrayStamped>("faces", 1, msg_connect_cb, msg_disconnect_cb);
if( debug_view_ ) {
subscriber_count_++;
}
std::string face_cascade_name, eyes_cascade_name;
local_nh_.param("face_cascade_name", face_cascade_name, std::string("/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml"));
local_nh_.param("eyes_cascade_name", eyes_cascade_name, std::string("/usr/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml"));
if( !face_cascade_.load( face_cascade_name ) ){ NODELET_ERROR("--Error loading %s", face_cascade_name.c_str()); };
if( !eyes_cascade_.load( eyes_cascade_name ) ){ NODELET_ERROR("--Error loading %s", eyes_cascade_name.c_str()); };
dynamic_reconfigure::Server<face_detection::FaceDetectionConfig>::CallbackType f =
boost::bind(&FaceDetectionNodelet::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
}
示例4: onInit
virtual void onInit()
{
nh_ = getNodeHandle();
it_ = boost::shared_ptr<image_transport::ImageTransport>(new image_transport::ImageTransport(nh_));
local_nh_ = ros::NodeHandle("~");
local_nh_.param("debug_view", debug_view_, false);
subscriber_count_ = 0;
prev_stamp_ = ros::Time(0, 0);
window_name_ = "Demo code to find contours in an image";
low_threshold_ = 100; // only for canny
image_transport::SubscriberStatusCallback img_connect_cb = boost::bind(&FindContoursNodelet::img_connectCb, this, _1);
image_transport::SubscriberStatusCallback img_disconnect_cb = boost::bind(&FindContoursNodelet::img_disconnectCb, this, _1);
ros::SubscriberStatusCallback msg_connect_cb = boost::bind(&FindContoursNodelet::msg_connectCb, this, _1);
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&FindContoursNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::ContourArrayStamped>("contours", 1, msg_connect_cb, msg_disconnect_cb);
if( debug_view_ ) {
subscriber_count_++;
}
dynamic_reconfigure::Server<find_contours::FindContoursConfig>::CallbackType f =
boost::bind(&FindContoursNodelet::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
}
示例5: onInit
virtual void onInit()
{
nh_ = getNodeHandle();
it_ = boost::shared_ptr<image_transport::ImageTransport>(new image_transport::ImageTransport(nh_));
local_nh_ = ros::NodeHandle("~");
local_nh_.param("debug_view", debug_view_, false);
subscriber_count_ = 0;
prev_stamp_ = ros::Time(0, 0);
window_name_ = "flow";
image_transport::SubscriberStatusCallback img_connect_cb = boost::bind(&FBackFlowNodelet::img_connectCb, this, _1);
image_transport::SubscriberStatusCallback img_disconnect_cb = boost::bind(&FBackFlowNodelet::img_disconnectCb, this, _1);
ros::SubscriberStatusCallback msg_connect_cb = boost::bind(&FBackFlowNodelet::msg_connectCb, this, _1);
ros::SubscriberStatusCallback msg_disconnect_cb = boost::bind(&FBackFlowNodelet::msg_disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(local_nh_).advertise("image", 1, img_connect_cb, img_disconnect_cb);
msg_pub_ = local_nh_.advertise<opencv_apps::FlowArrayStamped>("flows", 1, msg_connect_cb, msg_disconnect_cb);
if( debug_view_ ) {
subscriber_count_++;
}
dynamic_reconfigure::Server<fback_flow::FBackFlowConfig>::CallbackType f =
boost::bind(&FBackFlowNodelet::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
}
示例6: it
Omni_Vision(int argc, char **argv)
{
char * environment;
if((environment = getenv("AGENT"))==NULL)
{
ROS_ERROR("this agent number is not read by robot");
return ;
}
Agent_ID_ = atoi(environment);
std::stringstream ss;
ss<<Agent_ID_;
std::string calibration_path="/home/nubot"+ss.str()+"/nubot_ws/src/nubot/omni_vision/calib_results";
if(argc>1)
calibration_path=argv[1];
ROS_INFO("initialize the omni_vision process");
imginfo_ = new OmniImage(calibration_path+"/"+ss.str()+"/ROI.xml");
tranfer_ = new Transfer(calibration_path+"/"+ss.str()+"/mirror_calib.xml",*imginfo_);
scanpts_ = new ScanPoints(*imginfo_);
whites_ = new Whites(*scanpts_,*tranfer_);
optimise_ = new Optimise(calibration_path+"/errortable.bin",
calibration_path+"/Diff_X.bin",
calibration_path+"/Diff_Y.bin",
*tranfer_);
glocation_ = new Globallocalization(*optimise_);
odometry_ = new Odometry();
location_ = new Localization(*optimise_);
obstacles_ = new Obstacles(*scanpts_,*tranfer_);
ball_finder_ = new BallFinder(*tranfer_);
colorsegment_= new ColorSegment(calibration_path+"/"+ss.str()+"/CTable.dat");
is_show_ball_=false;
is_show_obstacles_=false;
is_show_whites_=false;
is_show_scan_points=false;
is_show_result_=false;
is_robot_stuck_ = false;
robot.isglobal_=true;
is_restart_=false;
is_power_off_=false;
if(WIDTH_RATIO<1)
field_image_ = cv::imread(calibration_path+"/"+ss.str()+"/field_mine.bmp");
else
field_image_ = cv::imread(calibration_path+"/"+ss.str()+"/field.bmp");
ros::NodeHandle nh;
image_transport::ImageTransport it(nh);
img_sub_= it.subscribe("/camera/image_raw", 1, &Omni_Vision::imageCallback,this);
ros::NodeHandle local_nh;
motor_info_sub_ = local_nh.subscribe("/nubotdriver/odoinfo", 1, &Omni_Vision::odometryupdate,this);
ros::NodeHandle node;
omin_vision_pub_ = node.advertise<nubot_common::OminiVisionInfo>("/omnivision/OmniVisionInfo",1);
reconfigureServer_.setCallback(boost::bind(&Omni_Vision::configure, this, _1, _2));
}
示例7: callback
void callback(dynamic_reconfigure::Server<dynamic_reconfigure::TestConfig>& srv, dynamic_reconfigure::TestConfig &config, uint32_t level)
{
ROS_INFO("Reconfigure request : %i %f %s %i %i Group1:%i Group2: %f %s", config.int_, config.double_, config.str_.c_str(), (int) config.bool_, config.level, config.group1_int, config.group2_double, config.group2_string.c_str());
config.int_ |= 1;
config.double_ = -config.double_;
config.str_ += "A";
config.bool_ = !config.bool_;
config.level = level;
dynamic_reconfigure::TestConfig max;
srv.getConfigMax(max);
max.int_ = max.int_ + 1;
srv.setConfigMax(max);
ROS_INFO("TEST");
ROS_INFO("Group 2 requested to be set to %d", config.groups.group_one.group2.state);
ROS_INFO("group2_doube requested to be set to %f", config.groups.group_one.group2.group2_double);
ROS_INFO("Reconfigured to : %i %f %s %i %i", config.int_, config.double_, config.str_.c_str(), (int) config.bool_, config.level);
}
示例8: RectangleDetector
RectangleDetector(ros::NodeHandle nh = ros::NodeHandle()) : it_(nh), nh_(nh)
{
image_sub = new message_filters::Subscriber<sensor_msgs::Image>(nh_, "image", 1);
line_sub = new message_filters::Subscriber<jsk_perception::LineArray>(nh_, "lines", 1);
sync = new TimeSynchronizer<sensor_msgs::Image, jsk_perception::LineArray>(*image_sub, *line_sub, 10);
sync->registerCallback(boost::bind(&RectangleDetector::callback, this, _1, _2));
image_pub_ = nh_.advertise<sensor_msgs::Image>("rectangle/image", 1);
dynamic_reconfigure::Server<jsk_perception::RectangleDetectorConfig>::CallbackType f =
boost::bind(&RectangleDetector::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
}
示例9: HoughLines
HoughLines(ros::NodeHandle nh = ros::NodeHandle()) : it_(nh), nh_(nh), subscriber_count_(0)
{
image_transport::SubscriberStatusCallback connect_cb = boost::bind(&HoughLines::connectCb, this, _1);
image_transport::SubscriberStatusCallback disconnect_cb = boost::bind(&HoughLines::disconnectCb, this, _1);
img_pub_ = image_transport::ImageTransport(ros::NodeHandle(nh_, "hough")).advertise("image", 1, connect_cb, disconnect_cb);
out_pub_ = nh.advertise<jsk_perception::LineArray>(nh_.resolveName("lines"), 1);
dynamic_reconfigure::Server<jsk_perception::HoughLinesConfig>::CallbackType f =
boost::bind(&HoughLines::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
}
示例10: getInitParams
/** get initial parameters (only when node starts). */
void getInitParams(void)
{
nh_.param("modulation_freq", modulation_freq_, -1);
std::string default_addr("");
nh_.param("ether_addr", ether_addr_, default_addr);
cinfo_ = new camera_info_manager::CameraInfoManager(nh_);
nh_.param("camera_name", camera_name_, std::string("swissranger"));
nh_.param("use_filter", use_filter_, static_cast<bool>(USE_FILTER));
dynamic_reconfigure::Server<swissranger_camera::SwissRangerConfig >::CallbackType f
= boost::bind(&SRNode::reconfig, this, _1, _2);
dynsrv.setCallback(f);
}
示例11: ColorHistogramDescriptorNode
ColorHistogramDescriptorNode() {
ros::NodeHandle nh;
dynamic_reconfigure::Server<saliency_detector::color_histogram_descriptor_paramsConfig>::CallbackType cb;
cb = boost::bind(&ColorHistogramDescriptorNode::configCallback, this, _1, _2);
dr_srv.setCallback(cb);
ros::NodeHandle private_node_handle_("~");
sub_patch_array =
nh.subscribe("projected_patch_array", 1, &ColorHistogramDescriptorNode::patchArrayCallback, this);
pub_named_points =
nh.advertise<samplereturn_msgs::NamedPointArray>("named_point", 1);
pub_debug_image =
nh.advertise<sensor_msgs::Image>("color_debug_image", 1);
}
示例12: PassthroughCarBody
PassthroughCarBody(){
ROS_INFO("START SUBSCRIBING");
point_sub = n.subscribe("input_points2", 1, &PassthroughCarBody::passthrough_cb, this);
point_pub = n.advertise<sensor_msgs::PointCloud2>("passthrough_output/points2", 1);
f = boost::bind(&PassthroughCarBody::dynamic_reconfigure_cb, this, _1, _2);
server.setCallback(f);
}
示例13: AngularRateControl
AngularRateControl() : nh_("~"),lastIMU_(0.0),
lastCommand_(0.0), timeout_(1.5),
joy_control_("/teleop/twistCommand"), auto_control_("/mux/safeCommand"),
manual_override_(false), rc_override_(true)
{
nh_.param("kp",kp_,1.0);
nh_.param("ki",ki_,0.0);
nh_.param("kd",kd_,0.0);
nh_.param("imax",imax_,1E9);
nh_.param("period",period_,0.05);
nh_.param("motor_zero",motor_zero_,0.0);
nh_.param("input_scale",input_scale_,1.0);
double dTimeout;
nh_.param("timeout",dTimeout,1.5);
timeout_ = ros::Duration(dTimeout);
Pid_.initPid(kp_,ki_,kd_,imax_,-imax_);
// Make sure TF is ready
ros::Duration(0.5).sleep();
// Subscribe to the velocity command and setup the motor publisher
imu_sub_ = nh_.subscribe("imu",1,&AngularRateControl::imu_callback,this);
cmd_sub_ = nh_.subscribe("command",1,&AngularRateControl::cmd_callback,this);
mux_sub_ = nh_.subscribe("/mux/selected",1,&AngularRateControl::mux_callback,this);
rc_sub_ = nh_.subscribe("/sense",1,&AngularRateControl::rc_callback,this);
motor_pub_ = nh_.advertise<geometry_msgs::Twist>("motors",1);
debug_pub_ = nh_.advertise<geometry_msgs::Point>("debug",1);
//Create a callback for the PID loop
pid_loop_ = nh_.createTimer(ros::Duration(period_), &AngularRateControl::do_pid, this);
f_ = boost::bind(&AngularRateControl::config_callback, this, _1, _2);
server_.setCallback(f_);
}
示例14:
object_segmentation_ros()
{
f = boost::bind(&object_segmentation_ros::configure_callback, this, _1, _2);
server.setCallback(f);
std::string get_scene_objects_remap;
n_.param("get_scene_objects_remap", get_scene_objects_remap, (std::string)"get_scene_objects");
get_scene_objects_ = n_.advertiseService<brics_3d_msgs::GetSceneObjects::Request , brics_3d_msgs::GetSceneObjects::Response>(get_scene_objects_remap, boost::bind(&object_segmentation_impl::callback_get_scene_objects, &component_implementation_,_1,_2,component_config_));
object_points_ = n_.advertise<sensor_msgs::PointCloud2>("object_points", 1);
plane_points_ = n_.advertise<sensor_msgs::PointCloud2>("plane_points", 1);
n_.param("camera_frame", component_config_.camera_frame, (std::string)"/openni_rgb_optical_frame");
n_.param("extract_obj_in_rgb_img", component_config_.extract_obj_in_rgb_img, (bool)false);
n_.param("min_x", component_config_.min_x, (double)0.25);
n_.param("max_x", component_config_.max_x, (double)1.5);
n_.param("min_y", component_config_.min_y, (double)-1.0);
n_.param("max_y", component_config_.max_y, (double)1.0);
n_.param("min_z", component_config_.min_z, (double)-0.1);
n_.param("max_z", component_config_.max_z, (double)1.0);
n_.param("threshold_points_above_lower_plane", component_config_.threshold_points_above_lower_plane, (double)0.01);
n_.param("downsampling_distance", component_config_.downsampling_distance, (double)0.005);
n_.param("min_points_per_objects", component_config_.min_points_per_objects, (int)11);
n_.param("spherical_distance", component_config_.spherical_distance, (double)2.5);
}
示例15:
eurobot2016_robotclaw_driver_ros() : np_("~")
{
f = boost::bind(&eurobot2016_robotclaw_driver_ros::configure_callback, this, _1, _2);
server.setCallback(f);
cmd_vel_ = n_.subscribe("cmd_vel", 1, &eurobot2016_robotclaw_driver_impl::topicCallback_cmd_vel, &component_implementation_);
}