Commit 17aed950 authored by Yvan Bosshard's avatar Yvan Bosshard
Browse files

getAnchor Service can now compile

parent c6ddb489
......@@ -18,15 +18,21 @@
#include "d_fall_pps/UWBAnchor.h"
#include "d_fall_pps/UWBAnchorArray.h"
#include "d_fall_pps/Anchors.h"
#include "std_msgs/Int32.h"
namespace d_fall_pps
// Callback to return anchor Positions
void getAnchorPositions(UWBAnchorArray &retAnchors);
bool getAnchorPositions(Anchors::Request& request, Anchors::Response& response);
// Reads anchor positions from yaml file
void readYaml();
// gets float vector from yaml file
void loadParameterFloatVector(ros::NodeHandle& nodeHandle, std::string name, std::vector<float>& val, int length);
// Callback to update anchor Positions
void updateAnchors(const std_msgs::Int32 &message);
\ No newline at end of file
......@@ -15,6 +15,7 @@
// along with this program. If not, see <>.
#include "AnchorPositions.h"
#include "d_fall_pps/Anchors.h"
#include <ros/package.h>
#include <string>
#include <vector>
......@@ -26,14 +27,16 @@ ros::NodeHandle nodeHandle("~");
int main(int argc, char* argv[])
ros::init(argc, argv, "UWBDataPublisher");
ros::NodeHandle nodeHandle("~");
ros::init(argc, argv, "AnchorPositions");
//ros::NodeHandle nodeHandle("~");
ros::ServiceServer anchorService = nodeHandle.advertiseService("getAnchors", getAnchorPositions);
ros::Subscriber anchorUpdate = nodeHandle.subscribe("/my_GUI/anchorUpdate", 1, updateAnchors);
return 0;
......@@ -78,9 +81,14 @@ void d_fall_pps::readYaml()
void d_fall_pps::getAnchorPositions(UWBAnchorArray &retAnchors)
bool d_fall_pps::getAnchorPositions(Anchors::Request& request, Anchors::Response& response)
retAnchors = anchors;
response.anchorArray = anchors;
\ No newline at end of file
return true;
void d_fall_pps::updateAnchors(const std_msgs::Int32 &message)
UWBAnchorArray anchorArray
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment