Category : ros

Autogenerated ROS (Robot Operating System) message C++ header files contain typedefs like this: typedef ::std_msgs::Header_<std::allocator<void> > Header; What does std::allocator<void> mean here? Why is the template type void? Here is the documentation for std::allocator<>: https://www.cplusplus.com/reference/memory/allocator/ https://en.cppreference.com/w/cpp/memory/allocator Here is the example autogenerated file to look at: http://docs.ros.org/en/electric/api/std_msgs/html/msg__gen_2cpp_2include_2std__msgs_2Header_8h_source.html. That first line above is line 116. This is ..

Read more

In my code, I have checked twice all the braces are balanced. Indentation is 2 spaces. In spite of all of this, I am getting this weird compilation error error: ‘IGN_PROFILE’ was not declared in this scope My code void amcl::PostUpdate(const ignition::gazebo::UpdateInfo &_info,ignition::gazebo::EntityComponentManager &_ecm) { IGN_PROFILE("amcl::PostUpdate"); —->Error in this line // Nothing left to do ..

Read more

Is there a way to separate the rclcpp::init(), rclcpp::executors::SingleThreadExecutor to spin node once and the rclcpp::shutdown() into separate function calls? I want to have separate function that handles the initialisation phase, run phase and the shutdown phase and I want to use Executor to perform spin_once() in a loop since I don’t want to get ..

Read more

This is the code snippet that’s giving this error. The line has been marked in the code snippet. Code class ignition::gazebo::systems::amclPrivate { public: Model model{kNullEntity}; public: bool updateAmclPose(const EntityComponentManager &_ecm); public: std::string fixed_frame_; public: std::string robot_frame_; public: double rate_; }; void amcl::Configure(const Entity &_entity, const std::shared_ptr<const sdf::Element> &_sdf, EntityComponentManager &_ecm, EventManager &_eventMgr) amcl_nh_.setCallbackQueue(& amcl_queue_); amcl_pub_ ..

Read more

I want to manipulate my robot arm (UR5e) to perform pick & place task so I use ROS and Moveit on Ubuntu 18.04 and I refer to Moveit tutorials (link below) https://github.com/ros-planning/moveit_tutorials/blob/melodic-devel/doc/move_group_interface/src/move_group_interface_tutorial.cpp And this is part of my code const std::vector<double> CAMERA_JOINT = {-1.57899937, -1.63659524, -1.02328654, -2.0525072, 1.57446152, 0.0}; const std::vector<double> HOME_JOINT = {-3.14159265, -1.01839962, ..

Read more

This is my code for the Adaptive Monte Carlo localization(AMCL) algorithm using ROS. #include <ignition/plugin/Register.hh> #include <ignition/gazebo/Model.hh> #include <ignition/gazebo/EntityComponentManager.hh> #include <ignition/gazebo/Util.hh> #include <ignition/gazebo/System.hh> //ROS libraries #include <ros/ros.h> #include <ros/callback_queue.h> // Dependencies #include <geometry_msgs/PoseWithCovarianceStamped.h> #include <tf2_ros/transform_listener.h> #include <geometry_msgs/TransformStamped.h> // STL #include <memory> #include <thread> #include <string> using namespace ignition; using namespace gazebo; using namespace systems; //////////////////////////////////////////////////////////////////////////// ..

Read more