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

janindu's profile - activity

2023-08-10 06:25:41 -0500 received badge  Good Answer (source)
2023-01-27 16:43:10 -0500 marked best answer Why doesn't ROS_INFO allow calling std::queue.size() inside as a param

I have declared a global variable queue

// Global variable for queue declaration
std::queue<geometry_msgs::PointStamped::ConstPtr> waypointQueue;

And I have subscribed to a topic. Here is my subscriber callback method.

/*
* Callback method to be executed on reception of a message
*/
void clickedPointsCb(const geometry_msgs::PointStamped::ConstPtr& msg) {
  ROS_INFO("%f %f %f", msg->point.x, msg->point.y, msg->point.z);
  waypointQueue.push(msg);
  ROS_INFO("%d", waypointQueue.size());
}

When I try to build this, I get the following error.

In file included from /opt/ros/indigo/include/ros/ros.h:40:0,
                 from /home/janindu/workspace/catkin_ws/src/turtlebot_waypoint_navigation/src/turtlebot_waypoint_navigation_v2.cpp:10:
/home/janindu/workspace/catkin_ws/src/turtlebot_waypoint_navigation/src/turtlebot_waypoint_navigation_v2.cpp: In function ‘void clickedPointsCb(const ConstPtr&)’:
/opt/ros/indigo/include/ros/console.h:342:176: warning: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘std::queue<int>::size_type {aka long unsigned int}’ [-Wformat=]
     ::ros::console::print(filter, __rosconsole_define_location__loc.logger_, __rosconsole_define_location__loc.level_, __FILE__, __LINE__, __ROSCONSOLE_FUNCTION__, __VA_ARGS__)
                                                                                                                                                                                ^
/opt/ros/indigo/include/ros/console.h:345:5: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER’
     ROSCONSOLE_PRINT_AT_LOCATION_WITH_FILTER(0, __VA_ARGS__)
     ^
/opt/ros/indigo/include/ros/console.h:375:7: note: in expansion of macro ‘ROSCONSOLE_PRINT_AT_LOCATION’
       ROSCONSOLE_PRINT_AT_LOCATION(__VA_ARGS__); \
       ^
/opt/ros/indigo/include/ros/console.h:557:35: note: in expansion of macro ‘ROS_LOG_COND’
 #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, __VA_ARGS__)
                                   ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:110:23: note: in expansion of macro ‘ROS_LOG’
 #define ROS_INFO(...) ROS_LOG(::ros::console::levels::Info, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)
                       ^
/home/janindu/workspace/catkin_ws/src/turtlebot_waypoint_navigation/src/turtlebot_waypoint_navigation_v2.cpp:58:3: note: in expansion of macro ‘ROS_INFO’
   ROS_INFO("%d", q.size());

However, if I modify the subscriber callback method as follows, it compiles and runs just fine.

/*
* Callback method to be executed on reception of a message
*/
void clickedPointsCb(const geometry_msgs::PointStamped::ConstPtr& msg) {
  ROS_INFO("%f %f %f", msg->point.x, msg->point.y, msg->point.z);
  waypointQueue.push(msg);
  int i = waypointQueue.size();
  ROS_INFO("%d", i);
}

Am I missing something?

2022-12-18 18:24:52 -0500 answered a question How do I install ROS Noetic on AWS Workspaces

Amazon Workspaces supports Amazon Linux, Ubuntu and Windows 10 as operating systems. From your question I understand tha

2022-07-15 07:07:45 -0500 received badge  Nice Answer (source)
2022-07-08 05:01:09 -0500 received badge  Good Answer (source)
2022-06-13 14:57:22 -0500 received badge  Nice Answer (source)
2021-12-21 22:37:02 -0500 commented answer How to get coordinate data in RPLidar Hector SLAM?

I assume the RPLidar is rigidly fixed to the AGV body, and that when you say you move the RPLidar, the AGV is moving wit

2021-12-20 17:25:05 -0500 answered a question How to get coordinate data in RPLidar Hector SLAM?

Assuming you have your network configured properly (following this : http://wiki.ros.org/ROS/NetworkSetup). you should b

2021-11-17 18:26:17 -0500 received badge  Rapid Responder (source)
2021-11-17 18:26:17 -0500 answered a question convert std_msgs/Time to float

Just use the to_sec method. time_float = msg.header.stamp.to_sec() ROS docs : http://wiki.ros.org/rospy/Overview/Time

2021-11-17 18:22:35 -0500 commented question robot_localization error in odometry with high pitch and tf wrong time

You can configure take the Z velocity in body frame = 0 as a measurement. Have you tried that? http://docs.ros.org/en/no

2021-11-17 01:47:40 -0500 commented question robot_localization error in odometry with high pitch and tf wrong time

Hi Nachum, I do not understand what you mean by "a robot that can move only on a plane (x-y body) but at a very steep pl

2021-11-16 00:19:59 -0500 received badge  Nice Answer (source)
2021-10-21 21:03:15 -0500 received badge  Rapid Responder (source)
2021-10-21 21:03:15 -0500 answered a question Reading data from Topic

You might want to look at the subscriber documentation. Essentially you need rospy.spin() so that the callbacks will be

2021-10-17 21:58:44 -0500 received badge  Rapid Responder (source)
2021-10-17 21:58:44 -0500 answered a question ROS2 Message generation in python package

Short answer : No. You can't generate messages on a ROS2 Foxy python package. However, since you can still have python

2021-09-27 02:05:41 -0500 commented question ROS launch error, RPLIDAR

Can you please do the following and update your question with the output of the commands? unplug the rplidar. Plug it

2021-09-27 02:04:47 -0500 commented question ROS launch error, RPLIDAR

Can you please do the following and update your question with the following? unplug the rplidar. Plug it back again a

2021-09-27 02:04:20 -0500 commented question ROS launch error, RPLIDAR

Can you please do the following and update your question with the following? unplug the rplidar. Plug it back again a

2021-09-27 02:03:47 -0500 commented question ROS launch error, RPLIDAR

Can you please do the following and update your question with the following? unplug the rplidar. Plug it back again a

2021-09-27 01:29:35 -0500 commented answer What is exact sync message filter?

Yes, that should work if you explicitly set the same timestamp to both image messages.

2021-09-27 01:03:38 -0500 answered a question What is exact sync message filter?

Publishers and subscribers in ROS are agnostic to each other. So I assume it is for making sure all the published im

2021-09-27 01:03:38 -0500 received badge  Rapid Responder (source)
2021-09-23 18:43:55 -0500 commented answer Creating a rosbag from images and imu data using bag.write

The imu data is inside a sensor_msgs.msg.Imu object, which is imported on this script in the first line. The data struct

2021-09-23 18:42:06 -0500 commented answer Why Rviz2 not confused when ydlidar publishes static tf2?

" it appears that it does not matter that the node publishes an invalid-for-my-bot transform as long as I start the robo

2021-09-23 18:36:21 -0500 commented answer Creating a rosbag from images and imu data using bag.write

The imu data is inside a sensor_msgs.msg.Imu object, which is imported on this script in the first line.

2021-09-22 18:14:49 -0500 commented question Fps drops during rosbag record and play back

Sounds like a network bandwidth issue. Can you please provide the following information? 1. Image size and published rat

2021-09-22 18:06:22 -0500 commented question Why Rviz2 not confused when ydlidar publishes static tf2?

This is very interesting. Could you edit your question to include your tf tree and the output of ros2 run tf2_ros tf2_ec

2021-09-21 18:58:05 -0500 received badge  Rapid Responder (source)
2021-09-21 18:58:05 -0500 answered a question Creating a rosbag from images and imu data using bag.write

All you need to do is to create a message instance with data, a topic name and a time stamp for bag, and write it to the

2021-09-17 01:18:22 -0500 edited answer bag to pcd file conversion

pcl_ros does not have that capability. After generating the .pcd files using rosrun pcl_ros bag_to_pcd <input_file.

2021-09-17 01:17:05 -0500 answered a question bag to pcd file conversion

pcl_ros does not have that capability. You can use a pcd-to-text tools publicly available like THIS and THIS

2021-09-17 01:11:17 -0500 edited answer Including custom header file in ROS2 CMakeList

Assuming your directory structure is something like this, tester123 src/ CMakeLists.txt package.xml Create another

2021-09-17 01:10:53 -0500 answered a question Including custom header file in ROS2 CMakeList

Assuming your directory structure is something like this, tester123 src/ CMakeLists.txt package.xml Create another

2021-09-16 19:12:17 -0500 commented question Unable to get subscriber event call backs

Can you clarify this statement please? " The code compiles and executes and the subscriber is able to receive the mess

2021-09-15 22:43:33 -0500 commented question Faster-than-realtime mapping in ROS 2

For "are there any rosbag2 readers that may be used to play data faster than it was recorded?", have you tried the -x or

2021-09-13 18:38:09 -0500 commented question amcl transforming laserscan

Is this on rviz? What's the global frame?

2021-09-05 23:11:42 -0500 edited answer ROS topic tools mux not registering my output when I roslaunch the mux node

If you dive into the code of the mux node here, you will see that the publisher is only advertised when the first messag

2021-09-05 23:09:33 -0500 answered a question ROS topic tools mux not registering my output when I roslaunch the mux node

If you dive into the code of the mux node here, you will see that the publisher is only advertised when the first messag

2021-09-05 23:09:33 -0500 received badge  Rapid Responder (source)
2021-09-05 18:37:13 -0500 commented answer hi, i have this error, how can i fix this??

This is starting to feel like an XY problem Why are you building hector-qrcode-detection package when you want to build

2021-09-02 22:36:11 -0500 answered a question hi, i have this error, how can i fix this??

You need to install or build from source hector-worldmodel-msgs package. It doesn't look like there is an apt repositor

2021-09-02 20:28:53 -0500 received badge  Rapid Responder (source)
2021-09-02 20:28:53 -0500 answered a question roslaunch if/unless for non-boolean arguments

You can do this using eval which evaluates an expression and returns a boolean. Eg, in your case you can do <rospara

2021-09-02 01:22:46 -0500 edited question My subscribe method (C++) is not invoked

My subscribe method (C++) is not invoked I am using ROS melodic in Docker environment. It consists of various systems an

2021-08-30 21:52:43 -0500 received badge  Rapid Responder (source)
2021-08-30 21:52:43 -0500 answered a question Problem running rviz through ssh: error creating render window

In etc/ssh/sshd_config of computer 2, set X11UseForwarding yes. Make sure to restart the ssh service in computer 2. use

2021-08-30 09:13:38 -0500 commented question Lost messages in a bag

What is the order of execution? Are you activating the publisher in one terminal first, and then start the rostopic echo

2021-08-30 09:12:57 -0500 commented question Lost messages in a bag

What is the order of execution? Are you activating the publisher in one terminal, and then start the rostopic echo in th