Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROS-O] add boost::placeholders:: #23

Open
wants to merge 2 commits into
base: noetic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions prosilica_camera/src/libprosilica/prosilica.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ static void openCamera(boost::function<tPvErr (tPvCameraInfo*)> info_fn,
Camera::Camera(unsigned long guid, size_t bufferSize)
: bufferSize_(bufferSize), FSTmode_(None)
{
openCamera(boost::bind(PvCameraInfo, guid, _1),
boost::bind(PvCameraOpen, guid, _1, &handle_));
openCamera(boost::bind(PvCameraInfo, guid, boost::placeholders::_1),
boost::bind(PvCameraOpen, guid, boost::placeholders::_1, &handle_));

setup();
}
Expand All @@ -186,8 +186,8 @@ Camera::Camera(const char* ip_address, size_t bufferSize)
{
unsigned long addr = inet_addr(ip_address);
tPvIpSettings settings;
openCamera(boost::bind(PvCameraInfoByAddr, addr, _1, &settings),
boost::bind(PvCameraOpenByAddr, addr, _1, &handle_));
openCamera(boost::bind(PvCameraInfoByAddr, addr, boost::placeholders::_1, &settings),
boost::bind(PvCameraOpenByAddr, addr, boost::placeholders::_1, &handle_));

setup();
}
Expand Down Expand Up @@ -459,7 +459,7 @@ static void getStringValuedAttribute(std::string &value,
void Camera::getAttributeEnum(const std::string &name, std::string &value)
{
getStringValuedAttribute(value,
boost::bind(PvAttrEnumGet, handle_, name.c_str(), _1, _2, _3));
boost::bind(PvAttrEnumGet, handle_, name.c_str(), boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3));
}

void Camera::getAttribute(const std::string &name, tPvUint32 &value)
Expand All @@ -480,7 +480,7 @@ std::string err_msg = "Couldn't get attribute " + name;
void Camera::getAttribute(const std::string &name, std::string &value)
{
getStringValuedAttribute(value,
boost::bind(PvAttrStringGet, handle_, name.c_str(), _1, _2, _3));
boost::bind(PvAttrStringGet, handle_, name.c_str(), boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3));
}

void Camera::setAttributeEnum(const std::string &name, const std::string &value)
Expand Down
12 changes: 6 additions & 6 deletions prosilica_camera/src/nodes/prosilica_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class ProsilicaNodelet : public nodelet::Nodelet

// Setup dynamic reconfigure server
reconfigure_server_.reset(new ReconfigureServer(config_mutex_, pn));
ReconfigureServer::CallbackType f = boost::bind(&ProsilicaNodelet::reconfigureCallback, this, _1, _2);
ReconfigureServer::CallbackType f = [this](auto cfg, uint lvl){ reconfigureCallback(cfg, lvl); };
reconfigure_server_->setCallback(f);
}

Expand Down Expand Up @@ -331,7 +331,7 @@ class ProsilicaNodelet : public nodelet::Nodelet
{
try
{
camera_->setKillCallback(boost::bind(&ProsilicaNodelet::kill, this, _1));
camera_->setKillCallback([this](unsigned long guid){kill(guid);});

if(auto_adjust_stream_bytes_per_second_ && camera_->hasAttribute("StreamBytesPerSecond"))
camera_->setAttribute("StreamBytesPerSecond", (tPvUint32)(115000000/num_cameras));
Expand Down Expand Up @@ -383,22 +383,22 @@ class ProsilicaNodelet : public nodelet::Nodelet
break;
case prosilica::Freerun:
NODELET_INFO("starting camera %s in freerun trigger mode", hw_id_.c_str());
camera_->setFrameCallback(boost::bind(&ProsilicaNodelet::publishImage, this, _1));
camera_->setFrameCallback([this](tPvFrame* frame){publishImage(frame);});
camera_->start(prosilica::Freerun, 1., prosilica::Continuous);
break;
case prosilica::FixedRate:
NODELET_INFO("starting camera %s in fixedrate trigger mode", hw_id_.c_str());
camera_->setFrameCallback(boost::bind(&ProsilicaNodelet::publishImage, this, _1));
camera_->setFrameCallback([this](tPvFrame* frame){publishImage(frame);});
camera_->start(prosilica::FixedRate, update_rate_, prosilica::Continuous);
break;
case prosilica::SyncIn1:
NODELET_INFO("starting camera %s in sync1 trigger mode", hw_id_.c_str());
camera_->setFrameCallback(boost::bind(&ProsilicaNodelet::publishImage, this, _1));
camera_->setFrameCallback([this](tPvFrame* frame){publishImage(frame);});
camera_->start(prosilica::SyncIn1, update_rate_, prosilica::Continuous);
break;
case prosilica::SyncIn2:
NODELET_INFO("starting camera %s in sync2 trigger mode", hw_id_.c_str());
camera_->setFrameCallback(boost::bind(&ProsilicaNodelet::publishImage, this, _1));
camera_->setFrameCallback([this](tPvFrame* frame){publishImage(frame);});
camera_->start(prosilica::SyncIn2, update_rate_, prosilica::Continuous);
break;
default:
Expand Down