Skip to content

Commit

Permalink
Relative path to save frame service.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vision Controller committed Sep 6, 2018
1 parent a7819ed commit 9ca5c2c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/RosInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ bool RosInterface::saveFrame(phoxi_camera::SaveFrame::Request &req, phoxi_camera
res.message = "Null frame!";
return true;
}
size_t pos = req.path.find("~");
if(pos != std::string::npos){
char* home = std::getenv("HOME");
if(!home){
res.message = "'~' found in 'path' parameter but environment variable 'HOME' not found. Export' HOME' variable or pass absolute value to 'path' parameter.";
res.success = false;
return true;
}
req.path.replace(pos,1,home);
}
ROS_INFO("path: %s",req.path.c_str());
frame->SaveAsPly(req.path);
res.message = OKRESPONSE;
res.success = true;
Expand Down

0 comments on commit 9ca5c2c

Please sign in to comment.