ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Rhapsodus's profile - activity

2023-03-06 06:10:15 -0500 received badge  Notable Question (source)
2023-03-06 06:10:15 -0500 received badge  Popular Question (source)
2022-06-17 08:16:05 -0500 received badge  Famous Question (source)
2021-09-29 03:26:07 -0500 received badge  Notable Question (source)
2021-05-21 03:48:48 -0500 received badge  Popular Question (source)
2021-03-17 18:49:01 -0500 commented answer Getting a compile error including rosgraph_msgs/Log

First off, I appreciate the help and sorry for not posting the Melodic / Ubuntu version. You are spot on correct here. T

2021-03-17 18:45:45 -0500 marked best answer Getting a compile error including rosgraph_msgs/Log

Greetings,

I am trying to use rosgraph_msgs/Log to subscribe to rosout and when I include the header file I get the following compile error:

<command-line>:0:7: error: expected identifier before numeric constant
/opt/ros/melodic/include/rosgraph_msgs/Log.h:95:5: note: in expansion of macro ‘DEBUG’
     DEBUG = 1,
     ^~~~~
<command-line>:0:7: error: expected ‘}’ before numeric constant
/opt/ros/melodic/include/rosgraph_msgs/Log.h:95:5: note: in expansion of macro ‘DEBUG’
     DEBUG = 1,
     ^~~~~
<command-line>:0:7: error: expected unqualified-id before numeric constant
/opt/ros/melodic/include/rosgraph_msgs/Log.h:95:5: note: in expansion of macro ‘DEBUG’
     DEBUG = 1,
     ^~~~~

In file included from ....
/opt/ros/melodic/include/rosgraph_msgs/Log.h:103:52: error: ‘ContainerAllocator’ was not declared in this scope
   typedef boost::shared_ptr< ::rosgraph_msgs::Log_<ContainerAllocator> > Ptr;
                                                    ^~~~~~~~~~~~~~~~~~
/opt/ros/melodic/include/rosgraph_msgs/Log.h:103:70: error: template argument 1 is invalid
   typedef boost::shared_ptr< ::rosgraph_msgs::Log_<ContainerAllocator> > Ptr;
                                                                      ^
/opt/ros/melodic/include/rosgraph_msgs/Log.h:103:72: error: template argument 1 is invalid
   typedef boost::shared_ptr< ::rosgraph_msgs::Log_<ContainerAllocator> > Ptr;
                                                                        ^
/opt/ros/melodic/include/rosgraph_msgs/Log.h:104:52: error: ‘ContainerAllocator’ was not declared in this scope
   typedef boost::shared_ptr< ::rosgraph_msgs::Log_<ContainerAllocator> const> ConstPtr;
                                                    ^~~~~~~~~~~~~~~~~~
/opt/ros/melodic/include/rosgraph_msgs/Log.h:104:70: error: template argument 1 is invalid
   typedef boost::shared_ptr< ::rosgraph_msgs::Log_<ContainerAllocator> const> ConstPtr;
                                                                      ^
/opt/ros/melodic/include/rosgraph_msgs/Log.h:104:77: error: template argument 1 is invalid
   typedef boost::shared_ptr< ::rosgraph_msgs::Log_<ContainerAllocator> const> ConstPtr;
                                                                             ^
/opt/ros/melodic/include/rosgraph_msgs/Log.h:110:45: error: ‘Log’ is not a member of ‘rosgraph_msgs’
 typedef boost::shared_ptr< ::rosgraph_msgs::Log > LogPtr;
                                             ^~~
/opt/ros/melodic/include/rosgraph_msgs/Log.h:110:45: note: suggested alternative: ‘Log_’
 typedef boost::shared_ptr< ::rosgraph_msgs::Log > LogPtr;
                                             ^~~
                                             Log_
/opt/ros/melodic/include/rosgraph_msgs/Log.h:110:45: error: ‘Log’ is not a member of ‘rosgraph_msgs’
/opt/ros/melodic/include/rosgraph_msgs/Log.h:110:45: note: suggested alternative: ‘Log_’
 typedef boost::shared_ptr< ::rosgraph_msgs::Log > LogPtr;
                                             ^~~
                                             Log_
/opt/ros/melodic/include/rosgraph_msgs/Log.h:110:49: error: template argument 1 is invalid
 typedef boost::shared_ptr< ::rosgraph_msgs::Log > LogPtr;
                                                 ^
/opt/ros/melodic/include/rosgraph_msgs/Log.h:111:45: error: ‘Log’ is not a member of ‘rosgraph_msgs’
 typedef boost::shared_ptr< ::rosgraph_msgs::Log const> LogConstPtr;
                                             ^~~
/opt/ros/melodic/include/rosgraph_msgs/Log.h:111:45: note: suggested alternative: ‘Log_’
 typedef boost::shared_ptr< ::rosgraph_msgs::Log const> LogConstPtr;
                                             ^~~
                                             Log_
/opt/ros/melodic/include/rosgraph_msgs/Log.h:111:45: error: ‘Log’ is not a member of ‘rosgraph_msgs’
/opt/ros/melodic/include/rosgraph_msgs/Log.h:111:45: note: suggested alternative: ‘Log_’
 typedef boost::shared_ptr< ::rosgraph_msgs::Log const> LogConstPtr;
                                             ^~~
                                             Log_
/opt/ros/melodic/include/rosgraph_msgs/Log.h:111:54: error: template argument 1 is invalid
 typedef boost::shared_ptr< ::rosgraph_msgs::Log const> LogConstPtr;
                                                      ^
/opt/ros/melodic/include/rosgraph_msgs/Log.h:155:1: error: expected declaration before ‘}’ token
 } // namespace rosgraph_msgs
 ^

When I comment out #include <rosgraph_msgs log.h=""> I compile fine. rosgraph_msgs is added to my catkin_package in cmake and in my package.xml. Versions: 1.11.2-0bionic.20201017.050047

Is ... (more)

2021-03-17 18:45:44 -0500 received badge  Scholar (source)
2021-03-17 13:41:10 -0500 edited question Getting a compile error including rosgraph_msgs/Log

Getting a compile error including rosgraph_msgs/Log Greetings, I am trying to use rosgraph_msgs/Log to subscribe to ros

2021-03-17 13:29:36 -0500 edited question Getting a compile error including rosgraph_msgs/Log

Getting a compile error including rosgraph_msgs/Log Greetings, I am trying to use rosgraph_msgs/Log to subscribe to ros

2021-03-17 13:26:07 -0500 edited question Getting a compile error including rosgraph_msgs/Log

Getting a compile error including rosgraph_msgs/Log Greetings, I am trying to use rosgraph_msgs/Log to subscribe to ros

2021-03-17 13:24:50 -0500 edited question Getting a compile error including rosgraph_msgs/Log

Getting a compile error including rosgraph_msgs/Log Greetings, I am trying to use rosgraph_msgs/Log to subscribe to ros

2021-03-17 13:24:04 -0500 asked a question Getting a compile error including rosgraph_msgs/Log

Getting a compile error including rosgraph_msgs/Log Greetings, I am trying to use rosgraph_msgs/Log to subscribe to ros

2020-12-17 13:20:16 -0500 received badge  Enthusiast
2020-12-16 18:28:09 -0500 received badge  Supporter (source)
2020-12-16 14:43:22 -0500 edited question Is it possible to modify static_map or specifically, the global cost map dynamically?

Is it possible to modify static_map or specifically, the global cost map dynamically? Greetings, I was hoping those mor

2020-12-16 14:43:22 -0500 received badge  Editor (source)
2020-12-16 14:42:27 -0500 edited question Is it possible to modify static_map or specifically, the global cost map dynamically?

Is it possible to modify static_map or specifically, the global cost map dynamically? Greetings, I was hoping those mor

2020-12-16 14:41:56 -0500 asked a question Is it possible to modify static_map or specifically, the global cost map dynamically?

Is it possible to modify static_map or specifically, the global cost map dynamically? Greetings, I was hoping those mor

2019-03-05 14:56:28 -0500 marked best answer Non blocking ros::init or roscore launch from c++ ?

Greetings All,

I am new to ROS but have managed to get networked drones communication to my application. I have a particular question though regarding Initialization and the best practices of the startup sequence.

When the app launches I make a call to ros::init. This call returns immediate and ros::ok returns true. However, when there is no roscore running trying to get a ros::NodeHandle hangs the application.

ros::init(argc, argv, "MyApp");

if( ros::ok() )
{
    ros::NodeHandle handle; //Hangs if no ros core.
}

My question is thus:

  1. How can I tell in code whether a roscore was running so the application doesn't hang?
  2. Is there a way to launch roscore from c++ if the above case is true.
2018-01-23 12:22:49 -0500 received badge  Famous Question (source)
2018-01-19 06:10:28 -0500 received badge  Self-Learner (source)
2018-01-19 06:10:28 -0500 received badge  Teacher (source)
2018-01-18 16:00:26 -0500 answered a question Non blocking ros::init or roscore launch from c++ ?

A colleague of mine pointed me to the call: ros::master::check() which does precisely what I was hoping for

2018-01-09 15:41:57 -0500 commented question Non blocking ros::init or roscore launch from c++ ?

Thanks! I see that I can launch via a launch file, but can you do the same in c++ API? Most people will just want to cli

2018-01-09 15:38:44 -0500 commented question Non blocking ros::init or roscore launch from c++ ?

Thanks, I see that I can launch roscore via a launch file, but can you do the same thing in c++. I ask because most peop

2018-01-09 08:51:03 -0500 received badge  Notable Question (source)
2018-01-08 16:46:42 -0500 received badge  Popular Question (source)
2018-01-08 14:50:59 -0500 asked a question Non blocking ros::init or roscore launch from c++ ?

Non blocking ros::init or roscore launch from c++ ? Greetings All, I am new to ROS but have managed to get networked dr