Closed xuqingwenkk closed 6 years ago
Which operating system are you using? Have you tried deleting and redownloading (recloning) everything?
I don't understand how you are able to run the program if it throws an error when compiling (this is only in CLion?). Have you double checked if you have specified topic remappings correctly? I don't see any in your command line.
Can you prepare an exact list of steps to reproduce it (e.g. make a directory, clone repozitory X, clone repozitory Y, open CLion, open project, set build type to RelWithDebInfo, compile, run roscore
, run rosbag play
, etc.)
I am using ubuntu 16.04 LTS + ros kinetic.
Actually, it didn't throw an error in CLion but there is red line below the code. When I move mouse on the code, the error Class 'boost::function<void(const sensor_msgs::LaserScan_<std::allocator<void>>::ConstPtr &)>' doesn't have a constructor 'function(void (*)(const sensor_msgs::LaserScan_<std::allocator<void>>::ConstPtr &))'
occurs.
My sensor data is published on topic /scan
and /odom
so that I didn't do any remappings.
My steps are as follows:
mkdir carto
cd carto
git clone https://github.com/ojura/cartographer_superbuild.git
cd cartographer_superbuild
git clone https://github.com/googlecartographer/cartographer.git
git clone https://github.com/googlecartographer/cartographer_ros.git
cd ..
I didn't download ceres-solver beacuse I have installed it.mkdir build
cd build
cmake ..
make - j4
'source devel/setup.bash'cartographer_superbuild
RelWithDebInfo
-configuration_directory /home/xuqw/carto/cartographer_superbuild/cartographer_ros/cartographer_ros/configuration_files -configuration_basename backup_2d.lua
roscore
in terminalRun
button in CLionrosbag play b2.bag
in terminalrostopic info /scan
but found no subscriber for /scan
topic.
That's all what I did. It seems that I have solved this issue. I didn't set use_sim_time
be true
and I didn't remapping topics. Thank you very much for your help.
Don't forget to publish clock from the bag as well when playing (--clock
). Also, check out the Cartographer offline node, it processes the bag at the maximum speed, so you don't have to play it.
Does it mean that the Cartographer offline node doesn't need the time stamp?
Hello, Thank you very much for providing the cmake support of cartographer. I have compiled them and run it in terminal successfully. However, cartographer node didn't subscribe sensor data when I run it in clion.
For the code
boost::function<void(const sensor_msgs::LaserScan::ConstPtr&)>( [this, trajectory_id, topic](const sensor_msgs::LaserScan::ConstPtr& msg) { map_builder_bridge_.sensor_bridge(trajectory_id) ->HandleLaserScanMessage(topic, msg); })));
there is an error says,Class 'boost::function<void(const sensor_msgs::LaserScan_<std::allocator<void>>::ConstPtr &)>' doesn't have a constructor 'function(void (*)(const sensor_msgs::LaserScan_<std::allocator<void>>::ConstPtr &))'
Other sensor callback meet the same error. However, I can pass the build but when I run the program, the cartographer node is always waiting, receive no data.
/home/xuqw/CLionProjects/carto/cartographer_superbuild/cmake-build-relwithdebinfo/devel/lib/cartographer_ros/cartographer_node -configuration_directory /home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer_ros/cartographer_ros/configuration_files -configuration_basename backpack_2d.lua [ INFO] [1501243771.055225301]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer_ros/cartographer_ros/configuration_files/backpack_2d.lua' for 'backpack_2d.lua'. [ INFO] [1501243771.055693767]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/map_builder.lua' for 'map_builder.lua'. [ INFO] [1501243771.055759021]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/map_builder.lua' for 'map_builder.lua'. [ INFO] [1501243771.055855055]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/sparse_pose_graph.lua' for 'sparse_pose_graph.lua'. [ INFO] [1501243771.055914091]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/sparse_pose_graph.lua' for 'sparse_pose_graph.lua'. [ INFO] [1501243771.056145692]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/trajectory_builder.lua' for 'trajectory_builder.lua'. [ INFO] [1501243771.056202782]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/trajectory_builder.lua' for 'trajectory_builder.lua'. [ INFO] [1501243771.056289882]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/trajectory_builder_2d.lua' for 'trajectory_builder_2d.lua'. [ INFO] [1501243771.056343157]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/trajectory_builder_2d.lua' for 'trajectory_builder_2d.lua'. [ INFO] [1501243771.056490949]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/trajectory_builder_3d.lua' for 'trajectory_builder_3d.lua'. [ INFO] [1501243771.056554242]: I0728 20:09:31.000000 757 configuration_file_resolver.cc:40] Found '/home/xuqw/CLionProjects/carto/cartographer_superbuild/cartographer/configuration_files/trajectory_builder_3d.lua' for 'trajectory_builder_3d.lua'. [ INFO] [1501243771.073532229]: I0728 20:09:31.000000 757 submaps.cc:188] Added submap 1 [ INFO] [1501243771.073686230]: I0728 20:09:31.000000 757 map_builder_bridge.cc:58] Added trajectory with ID '0'.
I have no idea on it. Could you give a hand? I will be very appreciated.