本文整理汇总了C++中dynamic_reconfigure::Server类的典型用法代码示例。如果您正苦于以下问题:C++ Server类的具体用法?C++ Server怎么用?C++ Server使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Server类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:TuZZiX,项目名称:ros_workspace,代码行数:35,代码来源:hough_circles_nodelet.cpp
示例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);
}
开发者ID:codehacken,项目名称:Athena,代码行数:30,代码来源:hough_lines_nodelet.cpp
示例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);
}
开发者ID:tuloski,项目名称:SherpaHighLevel,代码行数:31,代码来源:face_detection_nodelet.cpp
示例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);
}
开发者ID:srmanikandasriram,项目名称:vision_opencv,代码行数:28,代码来源:find_contours_nodelet.cpp
示例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);
}
开发者ID:TuZZiX,项目名称:ros_workspace,代码行数:27,代码来源:fback_flow_nodelet.cpp
示例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));
}
开发者ID:nubot-nudt,项目名称:nubot_ws,代码行数:56,代码来源:omnivision.cpp
示例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);
}
开发者ID:BenBallard,项目名称:dynamic_reconfigure,代码行数:19,代码来源:testserver.cpp
示例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);
}
开发者ID:HiroyukiMikita,项目名称:jsk_recognition,代码行数:13,代码来源:rectangle_detector.cpp
示例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);
}
开发者ID:HiroyukiMikita,项目名称:jsk_recognition,代码行数:13,代码来源:hough_lines.cpp
示例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);
}
开发者ID:hanliumaozhi,项目名称:open_ptrack,代码行数:15,代码来源:sr.cpp
示例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);
}
开发者ID:contradict,项目名称:SampleReturn,代码行数:19,代码来源:color_histogram_descriptor.cpp
示例12: onInit
virtual void onInit()
{
Nodelet::onInit();
it_ = boost::shared_ptr<image_transport::ImageTransport>(new image_transport::ImageTransport(*nh_));
pnh_->param("debug_view", debug_view_, false);
if (debug_view_) {
always_subscribe_ = true;
}
prev_stamp_ = ros::Time(0, 0);
window_name_ = "Hull Demo";
threshold_ = 100;
dynamic_reconfigure::Server<convex_hull::ConvexHullConfig>::CallbackType f =
boost::bind(&ConvexHullNodelet::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
img_pub_ = advertiseImage(*pnh_, "image", 1);
msg_pub_ = advertise<opencv_apps::ContourArrayStamped>(*pnh_, "hulls", 1);
onInitPostProcess();
}
开发者ID:mwimble,项目名称:kaimiPi,代码行数:22,代码来源:convex_hull_nodelet.cpp
示例13: onInit
virtual void onInit()
{
Nodelet::onInit();
it_ = boost::shared_ptr<image_transport::ImageTransport>(new image_transport::ImageTransport(*nh_));
pnh_->param("debug_view", debug_view_, false);
if (debug_view_) {
always_subscribe_ = true;
}
prev_stamp_ = ros::Time(0, 0);
window_name_ = "Contours";
threshold_ = 100;
dynamic_reconfigure::Server<general_contours::GeneralContoursConfig>::CallbackType f =
boost::bind(&GeneralContoursNodelet::reconfigureCallback, this, _1, _2);
srv.setCallback(f);
img_pub_ = advertiseImage(*pnh_, "image", 1);
rects_pub_ = advertise<opencv_apps::RotatedRectArrayStamped>(*pnh_, "rectangles", 1);
ellipses_pub_ = advertise<opencv_apps::RotatedRectArrayStamped>(*pnh_, "ellipses", 1);
onInitPostProcess();
}
开发者ID:mwimble,项目名称:kaimiPi,代码行数:24,代码来源:general_contours_nodelet.cpp
示例14: ArRobot
int RosAriaNode::Setup()
{
// Note, various objects are allocated here which are never deleted (freed), since Setup() is only supposed to be
// called once per instance, and these objects need to persist until the process terminates.
robot = new ArRobot();
ArArgumentBuilder *args = new ArArgumentBuilder(); // never freed
ArArgumentParser *argparser = new ArArgumentParser(args); // Warning never freed
argparser->loadDefaultArguments(); // adds any arguments given in /etc/Aria.args. Useful on robots with unusual serial port or baud rate (e.g. pioneer lx)
// Now add any parameters given via ros params (see RosAriaNode constructor):
// if serial port parameter contains a ':' character, then interpret it as hostname:tcpport
// for wireless serial connection. Otherwise, interpret it as a serial port name.
size_t colon_pos = serial_port.find(":");
if (colon_pos != std::string::npos)
{
args->add("-remoteHost"); // pass robot's hostname/IP address to Aria
args->add(serial_port.substr(0, colon_pos).c_str());
//ROS_INFO( "RosAria: using IP: [%s]", serial_port.substr(0, colon_pos).c_str() );
args->add("-remoteRobotTcpPort"); // pass robot's TCP port to Aria
args->add(serial_port.substr(colon_pos+1).c_str());
//ROS_INFO( "RosAria: using port: [%s]", serial_port.substr(colon_pos+1).c_str() );
}
else
{
args->add("-robotPort"); // pass robot's serial port to Aria
args->add(serial_port.c_str());
}
// if a baud rate was specified in baud parameter
if(serial_baud != 0)
{
args->add("-robotBaud");
char tmp[100];
snprintf(tmp, 100, "%d", serial_baud);
args->add(tmp);
}
if( debug_aria )
{
// turn on all ARIA debugging
args->add("-robotLogPacketsReceived"); // log received packets
args->add("-robotLogPacketsSent"); // log sent packets
args->add("-robotLogVelocitiesReceived"); // log received velocities
args->add("-robotLogMovementSent");
args->add("-robotLogMovementReceived");
ArLog::init(ArLog::File, ArLog::Verbose, aria_log_filename.c_str(), true);
}
// Connect to the robot
conn = new ArRobotConnector(argparser, robot); // warning never freed
if (!conn->connectRobot()) {
ROS_ERROR("RosAria: ARIA could not connect to robot! (Check ~port parameter is correct, and permissions on port device.)");
return 1;
}
// causes ARIA to load various robot-specific hardware parameters from the robot parameter file in /usr/local/Aria/params
if(!Aria::parseArgs())
{
ROS_ERROR("RosAria: ARIA error parsing ARIA startup parameters!");
return 1;
}
readParameters();
// Start dynamic_reconfigure server
dynamic_reconfigure_server = new dynamic_reconfigure::Server<rosaria::RosAriaConfig>;
/*
* 横向速度和纵向速度单位为米
*/
/*
* 初始化参数的最小值 其中TickMM=10 DriftFactor=-200 Revount=-32760
*/
// Setup Parameter Minimums
rosaria::RosAriaConfig dynConf_min;
dynConf_min.trans_accel = robot->getAbsoluteMaxTransAccel() / 1000;
dynConf_min.trans_decel = robot->getAbsoluteMaxTransDecel() / 1000;
// TODO: Fix rqt dynamic_reconfigure gui to handle empty intervals
// Until then, set unit length interval.
dynConf_min.lat_accel = ((robot->getAbsoluteMaxLatAccel() > 0.0) ? robot->getAbsoluteMaxLatAccel() : 0.1) / 1000;
dynConf_min.lat_decel = ((robot->getAbsoluteMaxLatDecel() > 0.0) ? robot->getAbsoluteMaxLatDecel() : 0.1) / 1000;
dynConf_min.rot_accel = robot->getAbsoluteMaxRotAccel() * M_PI/180;
dynConf_min.rot_decel = robot->getAbsoluteMaxRotDecel() * M_PI/180;
// I'm setting these upper bounds relitivly arbitrarily, feel free to increase them.
dynConf_min.TicksMM = 10;
dynConf_min.DriftFactor = -200;
dynConf_min.RevCount = -32760;
dynamic_reconfigure_server->setConfigMin(dynConf_min);
// 初始化参数的最大值 其中TickMM=200 DriftFactor=200 Revount=32760
rosaria::RosAriaConfig dynConf_max;
//.........这里部分代码省略.........
开发者ID:warcraft23,项目名称:MobileRobots,代码行数:101,代码来源:RosAria.cpp
示例15: 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);
}
开发者ID:YuOhara,项目名称:jsk_demos,代码行数:7,代码来源:passthrough_car_body.cpp
示例16: 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_);
}
开发者ID:pdrews,项目名称:ros_kf_control,代码行数:35,代码来源:csv_export.cpp
示例17:
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);
}
开发者ID:RC5Group2,项目名称:research-camp-5,代码行数:29,代码来源:object_segmentation_ros.cpp
示例18:
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_);
}
开发者ID:smart-robotics-team,项目名称:eurobot-ros-pkg,代码行数:9,代码来源:eurobot2016_robotclaw_driver_ros.cpp
示例19: initializeRos
void BeaconKFNode::initializeRos( void )
{
ros::NodeHandle private_nh("~");
ros::NodeHandle nh("");
private_nh.param("world_fixed_frame", _world_fixed_frame, std::string("map"));
private_nh.param("odometry_frame", _odometry_frame, std::string("odom"));
private_nh.param("platform_frame", _platform_frame, std::string("platform"));
//setup platform offset position and angle
int platform_index;
std::vector<double> empty_vec;
private_nh.param("platform_index", platform_index, 0);
private_nh.param("platform_x_coords", _platform_x_coords, empty_vec);
private_nh.param("platform_y_coords", _platform_y_coords, empty_vec);
double reference_x;
double reference_y;
private_nh.param("reference_x", reference_x, 1.0);
private_nh.param("reference_y", reference_y, 0.0);
_reference_coords.push_back(reference_x);
_reference_coords.push_back(reference_y);
double platform_angle;
private_nh.param("platform_orientation", platform_angle, 0.0);
_platform_origin.setX(_platform_x_coords[platform_index]);
_platform_origin.setY(_platform_y_coords[platform_index]);
_platform_origin.setZ(0);
platform_angle = platform_angle*(M_PI/180);
platform_angle = platform_angle + atan(_reference_coords[1]/_reference_coords[0]);
_platform_orientation = tf::createQuaternionFromYaw(platform_angle);
//beacon message subscriber callback
_beacon_sub = nh.subscribe( "beacon_pose", 1, &BeaconKFNode::beaconCallback, this);
//define timer rates
double update_period;
double broadcast_period;
private_nh.param("update_period", update_period, 1.0);
private_nh.param("broadcast_period", broadcast_period, 0.05);
//timer for broadcasting the map correction xfrom
_transform_broadcast_timer = private_nh.createTimer(ros::Duration(broadcast_period),
&BeaconKFNode::transformBroadcastCallback,
this);
//timer for updating the EKF
_update_timer = private_nh.createTimer(ros::Duration(update_period),
&BeaconKFNode::filterUpdateCallback,
this);
//set dynamic reconfigure callback
dr_server.setCallback(boost::bind(&BeaconKFNode::configCallback, this, _1, _2));
}
开发者ID:contradict,项目名称:SampleReturn,代码行数:55,代码来源:beacon_localizer_node.cpp
示例20:
common_servo_converter_ros() : np_("~")
{
f = boost::bind(&common_servo_converter_ros::configure_callback, this, _1, _2);
server.setCallback(f);
output_ = n_.advertise<std_msgs::UInt16>("output", 1);
input_ = n_.subscribe("input", 1, &common_servo_converter_impl::topicCallback_input, &component_implementation_);
np_.param("inverted", component_config_.inverted, (int)0);
np_.param("offset", component_config_.offset, (int)0);
}
开发者ID:smart-robotics-team,项目名称:common-smart-team-ros-pkg,代码行数:12,代码来源:common_servo_converter_ros.cpp
注:本文中的dynamic_reconfigure::Server类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论