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

Narton's profile - activity

2021-02-01 16:02:11 -0500 edited answer robot_localization with GPS map frame won't stay fixed

I had a similar problem and solved it by switching the input of navsat transform from 'ekf_odom' (local below) to 'ekf_m

2021-02-01 16:02:11 -0500 received badge  Editor (source)
2021-02-01 16:01:09 -0500 answered a question robot_localization with GPS map frame won't stay fixed

I had a similar problem and solved it by switching the input of navsat transform from 'ekf_odom' (local below) to 'ekf_m

2020-08-27 14:36:24 -0500 received badge  Famous Question (source)
2020-06-25 09:26:21 -0500 received badge  Notable Question (source)
2020-06-25 09:26:21 -0500 received badge  Popular Question (source)
2020-04-30 17:47:26 -0500 marked best answer Problems with boost::bind in a class with message_filter

Hello, I am attempting to use a class to synchronize subscription to a detection message [vision_msgs/Detection2DArray] and a camera_info message. I am getting compile errors when binding the TimeSynchronizer to the callback. I have viewed [https://answers.ros.org/question/1727...] but have not found any clues yet... The code and errors are below. Any help would be appreciated. Boost version 1.65.1, gcc version 7.5, ubuntu Bionic, Ros Melodic.

#include <ros/ros.h>
#include <image_geometry/pinhole_camera_model.h>
#include <message_filters/subscriber.h>
#include <message_filters/time_synchronizer.h>
#include <vision_msgs/Detection2D.h>
#include <vision_msgs/Detection2DArray.h>
#include <vision_msgs/ObjectHypothesisWithPose.h>
#include <sensor_msgs/CameraInfo.h>

using namespace vision_msgs;

class myClass{
  public:
  myClass():sync(det_sub, info_sub, 20)
  { 
    det_sub.subscribe(nh, "det", 20);
    info_sub.subscribe(nh, "camera_info", 20);
    sync.registerCallback(boost::bind(&myClass::callback, _1, _2 ));
  }

  private:
  void callback(Detection2DArrayConstPtr& det,sensor_msgs::CameraInfoConstPtr& cam_info)
  {
      //do stuff

      //publish stuff
  }

  ros::NodeHandle nh;
  message_filters::Subscriber<Detection2DArray> det_sub;
  message_filters::Subscriber<sensor_msgs::CameraInfo> info_sub;
  message_filters::TimeSynchronizer<Detection2DArray,sensor_msgs::CameraInfo> sync;
  image_geometry::PinholeCameraModel cam_model;

};

int main(int argc, char** argv)
{
  ros::init(argc, argv, "vision_node");

  /* 
  //want this in a class -- it compiles fine on its own
  message_filters::Subscriber<Detection2DArray> det_sub(nh, "det", 1);
  message_filters::Subscriber<sensor_msgs::CameraInfo> info_sub(nh, "camera_info", 1);
  message_filters::TimeSynchronizer<Detection2DArray,
            sensor_msgs::CameraInfo> sync(det_sub, info_sub, 10);
  sync.registerCallback(boost::bind(&callback, _1, _2));*/
  myClass aTest;
  ros::spin();

  return 0;
}

the errors are:

In file included from /usr/include/boost/bind.hpp:22:0,
                 from /opt/ros/melodic/include/ros/publisher.h:35,
                 from /opt/ros/melodic/include/ros/node_handle.h:32,
                 from /opt/ros/melodic/include/ros/ros.h:45,
                 from /home/hrrnxt/Workspace/RosStuff/camera_ws/src/bbox_undistort/src/bbox_undistort_node.cpp:1:
/usr/include/boost/bind/bind.hpp: In instantiation of ‘struct boost::_bi::result_traits<boost::_bi::unspecified, void (myClass::*)(boost::shared_ptr<const vision_msgs::Detection2DArray_<std::allocator<void> > >&, boost::shared_ptr<const sensor_msgs::CameraInfo_<std::allocator<void> > >&)>’:
/usr/include/boost/bind/bind.hpp:1284:48:   required from ‘class boost::_bi::bind_t<boost::_bi::unspecified, void (myClass::*)(boost::shared_ptr<const vision_msgs::Detection2DArray_<std::allocator<void> > >&, boost::shared_ptr<const sensor_msgs::CameraInfo_<std::allocator<void> > >&), boost::_bi::list2<boost::arg<1>, boost::arg<2> > >’
/home/hrrnxt/Workspace/RosStuff/camera_ws/src/bbox_undistort/src/bbox_undistort_node.cpp:18:66:   required from here
/usr/include/boost/bind/bind.hpp:75:37: error: ‘void (myClass::*)(boost::shared_ptr<const vision_msgs::Detection2DArray_<std::allocator<void> > >&, boost::shared_ptr<const sensor_msgs::CameraInfo_<std::allocator<void> > >&)’ is not a class, struct, or union type
     typedef typename F::result_type type;
                                     ^~~~
In file included from /usr/include/boost/function/detail/maybe_include.hpp:58:0,
                 from /usr/include/boost/function/detail/function_iterate.hpp:14,
                 from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:92,
                 from /usr/include/boost/function.hpp:64,
                 from /opt/ros/melodic/include/ros/forwards.h:40,
                 from /opt/ros/melodic/include/ros/common.h:37,
                 from /opt/ros/melodic/include/ros/ros.h:43,
                 from /home/hrrnxt/Workspace/RosStuff/camera_ws/src/bbox_undistort/src/bbox_undistort_node.cpp:1:
/usr/include/boost/function/function_template.hpp: In instantiation of ‘static void boost::detail::function::void_function_obj_invoker9<FunctionObj, R, T0, T1, T2, T3, T4, T5, T6 ...
(more)
2020-04-30 17:47:26 -0500 received badge  Scholar (source)
2020-04-30 07:45:00 -0500 asked a question Problems with boost::bind in a class with message_filter

Problems with boost::bind in a class with message_filter Hello, I am attempting to use a class to synchronize subscripti

2020-04-30 07:01:30 -0500 received badge  Famous Question (source)
2020-04-30 07:01:30 -0500 received badge  Notable Question (source)
2020-04-20 00:45:25 -0500 received badge  Enthusiast
2020-04-09 04:00:39 -0500 marked best answer [ROS2 Eloquent] Build from source rosdep error

Hello,

I am atempting to build ROS2 from source to include messages from vision_msgs package in ros bridge. I am following the instructions here. Everything goes well up until the section where I am supposed to use rosdep. I get an error:

    user@comp:~/Workspace/ros2_eloquent$ sudo rosdep init
Traceback (most recent call last):
  File "/usr/bin/rosdep", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3112, in <module>
    @_call_aside
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3096, in _call_aside
    f(*args, **kwargs)
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3125, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 580, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 593, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/hrrnxt/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 781, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'rosdistro>=0.7.5' distribution was not found and is required by rosdep

Am I supposed to source a ROS workspace to be able to build from source? My output from "env | grep ROS" is empty.

Running on Ubuntu 18.04.4 LTS, x64

2020-04-08 23:44:39 -0500 received badge  Popular Question (source)
2020-04-08 18:18:16 -0500 answered a question [ROS2 Eloquent] Build from source rosdep error

I ended up cleaning out the python2 and python3 environments of ros stuff, reinstalling ros-melodic, then had to 'pip2 i

2020-04-08 18:18:16 -0500 received badge  Rapid Responder (source)
2020-04-08 18:15:01 -0500 commented question [ROS2 Eloquent] Build from source rosdep error

Good point. I uninstalled a lot of ros stuff from both python2 and python3 using pip, then apt removed ros-*. Reinstall

2020-04-07 22:25:59 -0500 edited question [ROS2 Eloquent] Build from source rosdep error

[ROS2 Eloquent] Hello, I am atempting to build ROS2 from source to include messages from vision_msgs package in ros bri

2020-04-07 22:25:41 -0500 asked a question [ROS2 Eloquent] Build from source rosdep error

[ROS2 Eloquent] Hello, I am atempting to build ROS2 from source to include messages from vision_msgs package in ros bri

2020-02-15 18:12:20 -0500 received badge  Supporter (source)
2012-12-27 15:02:30 -0500 received badge  Enlightened (source)
2012-12-27 15:02:30 -0500 received badge  Guru (source)
2012-10-22 07:04:21 -0500 received badge  Great Answer (source)
2012-01-30 15:18:53 -0500 received badge  Good Answer (source)
2012-01-15 22:06:39 -0500 received badge  Nice Answer (source)
2011-12-15 16:04:54 -0500 received badge  Teacher (source)
2011-12-07 19:04:59 -0500 answered a question teleop_base compile errors from boost.

I got the same error, and looking through the output:

/opt/ros/electric/stacks/teleop_base/src/teleop_base_keyboard.cpp:104:85: error: cannot call constructor ‘boost::thread::thread’ directly [-fpermissive]

/opt/ros/electric/stacks/teleop_base/src/teleop_base_keyboard.cpp:104:85: error: for a function-style cast, remove the redundant ‘::thread’ [-fpermissive]

so I went into teleop_base/src/teleop_base_keyboard.cpp and removed the redundant '::thread'

It seems to work now.

Cheers!