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

itaouil's profile - activity

2022-04-09 08:15:30 -0500 received badge  Student (source)
2021-11-10 08:47:34 -0500 received badge  Nice Answer (source)
2020-06-17 22:49:21 -0500 received badge  Famous Question (source)
2020-04-14 09:33:13 -0500 commented answer Costmaps observation buffer has not been updated

Thanks for your reply, it indeed helped :).

2020-04-06 03:56:30 -0500 received badge  Self-Learner (source)
2020-04-06 03:56:30 -0500 received badge  Teacher (source)
2020-04-06 03:56:17 -0500 received badge  Notable Question (source)
2020-04-05 11:03:44 -0500 commented answer Could not transform the global plan to the frame of the controller

I also changed the global_frame from odom to map and I don't have localization issues anymore.

2020-04-05 11:02:52 -0500 received badge  Supporter (source)
2020-04-02 09:20:29 -0500 received badge  Enthusiast
2020-03-26 03:45:21 -0500 marked best answer How to use dwa_local_planner ROS wrapper C++ API

Hi,

UPDATE: This question was answered. Look at the answer below for a quick how-to :).

I am trying to use the ROS WRAPPER for the dwa_local_planner, however I am having some issues when I call the function dwaComputeVelocityCommands as it throws a segmentation fault on the function dwa_local_planner::DWAPlanner::findBestPath. This is the error throws:

Thread 1 "planner" received signal SIGSEGV, Segmentation fault.
0x00007ffff7b9e282 in dwa_local_planner::DWAPlanner::findBestPath(geometry_msgs::PoseStamped_<std::allocator<void> > const&, geometry_msgs::PoseStamped_<std::allocator<void> > const&, geometry_msgs::PoseStamped_<std::allocator<void> >&) ()
   from /opt/ros/melodic/lib/libdwa_local_planner.so

and here is the full backtrace from GDB:

(gdb) backtrace 
#0  0x00007ffff7b9e282 in dwa_local_planner::DWAPlanner::findBestPath(geometry_msgs::PoseStamped_<std::allocator<void> > const&, geometry_msgs::PoseStamped_<std::allocator<void> > const&, geometry_msgs::PoseStamped_<std::allocator<void> >&) ()
   from /opt/ros/melodic/lib/libdwa_local_planner.so
#1  0x00007ffff7ba8135 in dwa_local_planner::DWAPlannerROS::dwaComputeVelocityCommands(geometry_msgs::PoseStamped_<std::allocator<void> >&, geometry_msgs::Twist_<std::allocator<void> >&) () from /opt/ros/melodic/lib/libdwa_local_planner.so
#2  0x0000555555580516 in Planner::dwaTrajectoryControl(hsr_planner::ClutterPlannerService const&) ()
#3  0x000055555557f92d in Planner::requestClutterPlan() ()
#4  0x000055555557ed85 in Planner::Planner(tf2_ros::Buffer&, tf2_ros::TransformListener&) ()
#5  0x0000555555580b31 in main ()

I am not sure whether this is a bug in my code or on the API itself, and I have bee trying to solve this issue for a bunch of hours already so I would like to know whether the steps I took are correct or not, or if you have any suggestion, please :).

How I Initialize

I start by creating the tf2 Buffer as well as the TransformListener in the main and then passing these to the constructor of the Class in order to populate the costmap (pointer) and the dynamic planner.

Here is the main:

int main(int argc, char **argv)
{
    // Create ROS node
    ros::init(argc, argv, "planner");
    ROS_INFO("Created Planner node...");

    // TF2 objects
    tf2_ros::Buffer l_buffer(ros::Duration(10));
    tf2_ros::TransformListener l_tf(l_buffer);

    // Create Planner instance
    Planner planner(l_buffer, l_tf);

    // Spin ROS
    ros::spin();

    return 0;
}

and here is the initialization of the members costmap and dynamic planner in the class (or how I do it):

// Create shared pointers instances
m_costMap = new costmap_2d::Costmap2DROS("hsr_costmap", m_buffer);

// Initialize dwa local planner
m_dp.initialize("hrs_dwa_planner", &m_buffer, m_costMap);

Afterwards, I set the global plan using setPlan which is always successful and works well, and proceed to compute the velocities using dwaComputeVelocityCommands passing to it the global pose obtained from the costmap pointer and the Twist object as follows:

    // Set global plan for local planner
    if (m_dp.setPlan(p_service.response.path))
    {
        ROS_INFO("DWA set plan: SUCCESS");
    }
    else
    {
        ROS_ERROR("DWA set plan: FAILED");
    }

    // Create twist messag to be
    // populate by the local planner
    geometry_msgs::Twist l_cmd_vel;
    l_cmd_vel.linear.x = 0;
    l_cmd_vel.linear.y = 0;
    l_cmd_vel.linear.z = 0;
    l_cmd_vel.angular.x = 0;
    l_cmd_vel.angular.y = 0;
    l_cmd_vel.angular.z = 0;

    // Get robot pose in the map
    geometry_msgs::PoseStamped l_global_pose;
    m_costMap->getRobotPose(l_global_pose);

    // Keep sending commands
    // until goal is reached
    while (!m_dp.isGoalReached())
    {
        ROS_INFO(m_dp.isGoalReached());

        // Compute velocity commands
        if (m_dp.dwaComputeVelocityCommands(l_global_pose, l_cmd_vel))
        {
            ROS_INFO("DWA compute cmd_vel: SUCCESS");
        }
        else
        {
            ROS_ERROR("DWA compute cmd_vel: FAILED");
        }

        // Send commands
        m_velPub.publish(l_cmd_vel ...
(more)
2020-03-25 15:52:05 -0500 edited question How to use dwa_local_planner ROS wrapper C++ API

How to use dwa_local_planner ROS wrapper C++ API Hi, UPDATE: This question was answered. Look at the answer below for a

2020-03-25 15:51:06 -0500 answered a question How to use dwa_local_planner ROS wrapper C++ API

I managed to get the dwa_local_planner work. For anyone wanting to set it up, here is a quick tutorial on how to do it.

2020-03-25 15:51:06 -0500 received badge  Rapid Responder (source)
2020-03-25 15:20:42 -0500 edited question How to use dwa_local_planner ROS wrapper C++ API

dwa_local_planner API segmentation fault Hi, I am trying to use the ROS WRAPPER for the dwa_local_planner, however I am

2020-03-25 09:58:39 -0500 edited question How to use dwa_local_planner ROS wrapper C++ API

dwa_local_planner API segmentation fault Hi, I am trying to use the ROS WRAPPER for the dwa_local_planner, however I am

2020-03-25 09:43:31 -0500 commented question How to use dwa_local_planner ROS wrapper C++ API

I don't have enough points to upload the tf tree image, but it seems good to me. If you have any suggestions on how I ca

2020-03-25 09:40:40 -0500 received badge  Popular Question (source)
2020-03-25 09:11:20 -0500 edited question How to use dwa_local_planner ROS wrapper C++ API

dwa_local_planner API segmentation fault Hi, I am trying to use the ROS WRAPPER for the dwa_local_planner, however I am

2020-03-25 09:10:56 -0500 commented question How to use dwa_local_planner ROS wrapper C++ API

Hi, Yeah I meant ROS wrapper. Thanks for the note :).

2020-03-25 06:40:39 -0500 asked a question dwa_local_planner API segmentation fault

dwa_local_planner API segmentation fault Hi, I am trying to use the ROS API for the dwa_local_planner, however I am hav

2020-03-25 06:40:39 -0500 asked a question How to use dwa_local_planner ROS wrapper C++ API

dwa_local_planner API segmentation fault Hi, I am trying to use the ROS API for the dwa_local_planner, however I am hav

2019-05-20 01:35:31 -0500 marked best answer Machine Learning Algorithm

Hey,

Would it be possible to know which Machine Learning Algorithm was used to find leg patterns in the returned laser scans reading in the leg_detector ROS package ( http://wiki.ros.org/leg_detector ) ?

Greetings,

Ilyass

2018-04-23 02:19:51 -0500 received badge  Famous Question (source)
2018-02-28 09:28:23 -0500 received badge  Notable Question (source)
2018-02-28 09:18:27 -0500 commented answer Machine Learning Algorithm

Thank you!

2018-02-28 05:57:01 -0500 received badge  Popular Question (source)
2018-02-28 03:20:58 -0500 commented question Machine Learning Algorithm

Hey Chriss, I updated my question. I meant the following package http://wiki.ros.org/leg_detector :)

2018-02-28 03:19:42 -0500 edited question Machine Learning Algorithm

Machine Learning Algorithm Hey, Would it be possible to know which Machine Learning Algorithm was used to find leg patt

2018-02-28 03:19:34 -0500 edited question Machine Learning Algorithm

Machine Learning Algorithm Hey, Would it be possible to know which Machine Learning Algorithm was used to find leg patt

2018-02-28 03:19:34 -0500 received badge  Editor (source)
2018-02-28 03:18:32 -0500 edited question Machine Learning Algorithm

Machine Learning Algorithm Hey, Would it be possible to know which Machine Learning Algorithm was used to find leg patt

2018-02-28 03:11:44 -0500 asked a question Machine Learning Algorithm

Machine Learning Algorithm Hey, Would it be possible to know which Machine Learning Algorithm (SVMs, ANN, etc) was used

2018-02-28 03:11:44 -0500 asked a question Machine Learning Algorithm

Machine Learning Algorithm Hey, Would it be possible to know which Machine Learning Algorithm was used to find the leg_