Thank you it worked. Now when I launch the server.cpp node I could able to see the service in rosnode info or service list but if i put the service inside the main node.cpp file I cannot see the service being advertised
#include <ros ros.h="">
#include <cstdio> // for FILE defn
#include <iostream> // for cout, etc
#include <time.h> // for clock_t and clock
#include <list>
#include <string>
#include <cstring>
#include <sensor_msgs jointstate.h="">
#include "turtlesim/Velocity.h"
#include <biclops homingsequence.h="">
using namespace std;
using namespace ros;
#include <biclops.h>
#include <pmdutils.h>
// Defines which axes we want to use.
int axisMask=Biclops::PanMask
+ Biclops::TiltMask;;
// Pointers to each axis (populated once controller is initialized).
PMDAxisControl *panAxis = NULL;
PMDAxisControl *tiltAxis = NULL;
// THE interface to Biclops
Biclops biclops_obj;
ros::Subscriber key_sub;
ros::Publisher joint_pub;
sensor_msgs::JointState joint_state;
bool Homing(biclops::HomingSequence::Request &req,
biclops::HomingSequence::Request &res){
ROS_INFO("Performing Homing Sequence");
//biclops.Initialize(&req.path);
return true;
}
//----------------------------------------------------------------------------
int main (int argc, char *argv[]) {
ros::init(argc,argv,"Biclops");
ROS_INFO("node creation");
ros::NodeHandle nh;
ros::Rate loop_rate(10);
// ROS_INFO("ARGV : %s ",argv[1]);
argv[1]="/home/yeshi/catkin_ws/src/biclops/BiclopsDefault.cfg";
ROS_INFO( "\n\nBasic Biclops Running Example\n\n" );
//Initializing
cout<<"Initialization Routine"<<biclops_obj.Initialize(argv[1])<<endl;
if (!biclops_obj.Initialize(argv[1]))
{
ROS_INFO( "Failed to open Biclops Communication\n" );
ROS_INFO( "Press Enter key to terminate...\n" );
getchar();
//return 0;
}
else
ROS_INFO( "Succeed to open Biclops Communication\n" );
//Homing sequence Service
ros::ServiceServer service =nh.advertiseService("homing_sequence",Homing);
// Get shortcut references to each axis.
panAxis = biclops_o
while(ros::ok() ){
spin();
loop_rate.sleep();
}
return 0;
}
What am I missing. I made the same changes as needed for the server.cpp file in the CMakeLists.txt. Please help me
Please provide the error message