ROS-Industrial Special Project: Cartesian Path Planner
129
stars
91
forks
source link
when I use descartes to move a specf cartesian path ,I found that the robot trajectory will cause collision to the environment #256
Open
dbdxnuliba opened 3 years ago
I has list part of the code of application :
int main(int argc,char** argv) { ros::init(argc,argv,"plan_and_run"); ros::AsyncSpinner spinner(2); spinner.start(); moveit::planning_interface::PlanningSceneInterface scene;
// creating application plan_and_run::DemoApplication application;
// loading parameters application.loadParameters(); application.loadEnv(scene);
// initializing ros components application.initRos();
// initializing descartes application.initDescartes();
// moving to home position application.moveHome();
// generating trajectory plan_and_run::DescartesTrajectory traj; application.generateTrajectory(traj);
// planning robot path plan_and_run::DescartesTrajectory output_path; application.planPath(traj,output_path);
// running robot path application.runPath(output_path);
// exiting ros node spinner.stop();
return 0; }
void DemoApplication::initDescartes() { robot_modelptr.reset(new ur3_demo_descartes::UR3RobotModel());
// //Enable collision checking robot_modelptr->setCheckCollisions(true);
if(robot_modelptr->initialize(ROBOT_DESCRIPTIONPARAM, config.groupname, config.worldframe, config.tip_link)) { ROS_INFO_STREAM("Descartes Robot Model initialized"); } else { ROS_ERROR_STREAM("Failed to initialize Robot Model"); exit(-1); }
bool succeeded = planner_.initialize(robot_modelptr); if(succeeded) { ROS_INFO_STREAM("Descartes Dense Planner initialized"); } else { ROS_ERROR_STREAM("Failed to initialize Dense Planner"); exit(-1); }
ROS_INFO_STREAM("Task '"<<FUNCTION<<"' completed"); }
}
void DemoApplication::loadEnv(moveit::planning_interface::PlanningSceneInterface& scene) { ros::NodeHandle pnh("~");
//pose.position.z = -high / 2.0; pose.position.z = 0.2;
ROS_INFO_STREAM("Task '"<<FUNCTION<<"' completed");
}