ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question

Nissrine's profile - activity

2017-08-23 04:24:28 -0600 received badge  Famous Question (source)
2017-08-23 04:24:28 -0600 received badge  Notable Question (source)
2017-06-02 03:50:56 -0600 received badge  Famous Question (source)
2016-07-11 14:10:31 -0600 received badge  Popular Question (source)
2016-07-06 09:17:11 -0600 commented question How to solve error Invoking make when creating a subscriber node?

Is there a way to do it without ar_track_alvar_msgs? I have the hydro distribution and that package comes indigo and after.

2016-07-06 09:16:21 -0600 received badge  Notable Question (source)
2016-07-01 01:22:28 -0600 received badge  Popular Question (source)
2016-06-30 13:38:36 -0600 answered a question How to solve error Invoking make when creating a subscriber node?

This is what is in my Cmakelist:

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
ar_track_alvar
tf
)
catkin_package(
 INCLUDE_DIRS include
  LIBRARIES beginner_tutorials
  CATKIN_DEPENDS roscpp rospy std_msgs
  DEPENDS system_lib
)
include_directories(
  ${catkin_INCLUDE_DIRS}
)
add_executable(Bearings src/Bearings.cpp)
target_link_libraries(Bearings ${catkin_LIBRARIES})
add_dependencies(Bearings ar_track_alvar_msgs_AlvarMarker)

And this is what the error in the terminal looks like:

> /home/nissrine/catkin_ws/src/beginner_tutorials/src/Bearings.cpp:2:45:
> fatal error:
> ar_track_alvar_msgs/AlvarMarker.h: No
> such file or directory compilation
> terminated. make[2]: ***
> [beginner_tutorials/CMakeFiles/Bearings.dir/src/Bearings.cpp.o]
> Error 1 make[1]: ***
> [beginner_tutorials/CMakeFiles/Bearings.dir/all]
> Error 2 make: *** [all] Error 2
> Invoking "make" failed
> nissrine@nissrine-VirtualBox:~/catkin_ws$

I hope this helps,

Thanks again for your help

2016-06-30 11:40:03 -0600 asked a question I get an error saying “Invoking make failed” when I run catkin_make after to compile a subscriber I created

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

2016-06-30 11:37:03 -0600 asked a question How to solve error Invoking make when creating a subscriber node?

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. This is my subscriber code

I included at the beginning of the code ros.h, AlvarMarker.h, pose.h, tf.h and trasform_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 these these lines to my cmakelist:

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

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  ar_track_alvar
  tf
)

Thank you for your help,

Nissrine

EDIT

This is what is in my Cmakelist:

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
ar_track_alvar
tf
)
catkin_package(
 INCLUDE_DIRS include
  LIBRARIES beginner_tutorials
  CATKIN_DEPENDS roscpp rospy std_msgs
  DEPENDS system_lib
)
include_directories(
  ${catkin_INCLUDE_DIRS}
)
add_executable(Bearings src/Bearings.cpp)
target_link_libraries(Bearings ${catkin_LIBRARIES})
add_dependencies(Bearings ar_track_alvar_msgs_AlvarMarker)

And this is what the error in the terminal looks like:

> /home/nissrine/catkin_ws/src/beginner_tutorials/src/Bearings.cpp:2:45:
> fatal error:
> ar_track_alvar_msgs/AlvarMarker.h: No
> such file or directory compilation
> terminated. make[2]: ***
> [beginner_tutorials/CMakeFiles/Bearings.dir/src/Bearings.cpp.o]
> Error 1 make[1]: ***
> [beginner_tutorials/CMakeFiles/Bearings.dir/all]
> Error 2 make: *** [all] Error 2
> Invoking "make" failed
> nissrine@nissrine-VirtualBox:~/catkin_ws$

I hope this helps,

Thanks again for your help