I get an error saying “Invoking make failed” when I run catkin_make after to compile a subscriber I created [closed]

asked 2016-06-30 11:40:03 -0600

Nissrine gravatar image

Hi Guys,

I am trying to create a subscriber called Bearings that will take the pose (x, y and z) from ar_track_alvar package and output a bearing 'a' and and angle 'b' using mathematical formulas. I tried to follow the beginner tutorial for creating a subscriber. I get an error saying invoking make failed. Here is my subscriber code, my CMakeList and a screenshot of the terminal error. Subscriber code:

#include <ros/ros.h>
#include <ar_track_alvar_msgs/AlvarMarker.h>
#include <std_msgs/Header.h>
#include <ar_track_alvar/AlvarMarker.h>
#include <ar_track_alvar/pose.h>
#include <tf/tf.h>
#include <tf/transform_datatypes.h>


void printPose(const ar_track_alvar_msgs::AlvarMarker::ConstPtr& msg)
{
float a
float b
tf::Pose X;
tf::Pose Y;
tf::Pose Z;
X.setOrigin(tf::pointMsgToTF(msg->pose.pose.position.x));
Y.setOrigin(tf::pointMsgToTF(msg->pose.pose.position.y));
Z.setOrigin(tf::pointMsgToTF(msg->pose.pose.position.z));

a = sqrt(X^2 +Y^2);
b = atan((Z/a);
ROS_INFO("distance: ", a, "Angle", b);
}
int main(int argc, char **argv)
{ros::init(argc, argv, "Bearings");
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe("ar_pose_marker",1000,printPose);
ros:: spin();
return 0;}

I added this to my CmakeList.txt:

add_executable(Bearings src/Bearings.cpp)
target_link_libraries(Bearings ${catkin_LIBRARIES})
add_dependencies(Bearings ar_track_alvar_msgs_AlvarMarker)

as well as this:

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
ar_track_alvar
tf
)

Thanks for you help,

Nissrine

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by jarvisschultz
close date 2016-06-30 12:37:48.004107

Comments

jarvisschultz gravatar image jarvisschultz  ( 2016-06-30 12:38:09 -0600 )edit