Robotics StackExchange | Archived questions

What is the cause of Segmentation fault (core dumped) error?

Hello I am facing the error Segmentation fault (core dumped) I did some searching but those answers didn't solve my problem. I am posting the piece of code where the issue occurs when program control reaches there.

ROS_INFO("Waiting for tf between kinect_pc_frame and base_link...");

while (tferr) {
    tferr = false;
    try {
        ROS_INFO("In try segment");
        tfListener.lookupTransform("base_link", "kinect_pc_frame", ros::Time(0), stf_kinect_wrt_base);
    }
    catch (tf::TransformException &exception) {
        //ROS_INFO("%s; retrying...", exception.what());
        ROS_INFO("In catch segment");
        ROS_WARN("%s; retrying...", exception.what());
        tferr = true;
        ros::spinOnce();
        ros::Duration(1.0).sleep(); // Sleep for a second
    }
    ROS_INFO("In while loop");
}

This is the output of my program.

[ INFO] [1684993785.768478917]: Instantiating the object finder action server: 
[ INFO] [1684993785.772273471]: Initializing Subscribers
[ INFO] [1684993785.778974621]: Initializing Publishers
[ INFO] [1684993785.779501828]: In the constructor of ObjectFinder...
[ INFO] [1684993785.792039165]: Listening for kinect-to-base transform:
[ INFO] [1684993785.792072071]: Waiting for tf between kinect_pc_frame and base_link...
[ INFO] [1684993785.792085193]: In try segment
[ INFO] [1684993785.792193479]: In catch segment
[ WARN] [1684993785.792211168]: "base_link" passed to lookupTransform argument target_frame does not exist. ; retrying...
Segmentation fault (core dumped)

I tried without

ros::spinOnce(); ros::Duration(1.0).sleep()

But no success. Your help would highly be appreciated.

Asked by Ibrahim_aerospace on 2023-05-25 01:00:34 UTC

Comments

Answers