xArm-Developer / xArm-CPLUS-SDK

C++ SDK for UFACTORY robots, 850, xArm5/6/7, and Lite6.
https://www.ufactory.cc/
BSD 3-Clause "New" or "Revised" License
45 stars 29 forks source link

*** stack smashing detected ***: terminated #20

Open Akumar201 opened 6 months ago

Akumar201 commented 6 months ago

I have created code to send the arm to manual or emergency switch mode. The code are following , I am not sure why when I run any of this my code fails

message is EmergencyStop Emergency Stop for Arm has been engaged stack smashing detected : terminated Main process exited, code=killed, status=6/ABRT Failed with result 'signal'.

Manual Mode Code looks like

void XArmWrapper::ManualMode()
{
 // if (arm->error_code != 0) arm->clean_error();
 // if (arm->warn_code != 0) arm->clean_warn();
 arm->motion_enable(false);
 arm->motion_enable(true);
 arm->clean_error();
 arm->clean_warn();
 arm->set_mode(0);
 arm->set_state(0);
 arm->set_mode(2);
 arm->set_state(0);
}

emergency switch code looks like


bool XArmWrapper::EmergencyStop()
{
 if (arm != nullptr)
 {
   arm->motion_enable(false);
   std::cout << "arm value is " << arm << std::endl;

   return true;
 }
 else
 {
   std::cerr << "Error: Arm is not initialized" << std::endl;
   return false;
 }
}