Closed Akumar201 closed 1 year ago
Well, you might increase hard_stop_singularity_threshold
to something more than 100. Can you attach a picture of the arm when it's at the singularity? This might be unavoidable if the arm really is at a singularity.
You could also tweak the settings of bio_ik
in kinematics.yaml.
This would be advanced functionality but you could also define a custom cost function for bio_ik. I'm sorry I don't know how to do that off the top of my head.
Hi @AndyZe thank you so much for your reply. I narrow down the reasons that might be causing it. Let me explain the for future users seeking for the answer, I think I am doing following things wrong
// Get the current EE transform
geometry_msgs::TransformStamped current_ee_tf;
tracker.getCommandFrameTransform(current_ee_tf);
std::cout << current_ee_tf << std::endl;
// Convert it to a Pose
geometry_msgs::PoseStamped target_pose;
target_pose.header.frame_id = current_ee_tf.header.frame_id;
target_pose.pose.position.x = current_ee_tf.transform.translation.x;
target_pose.pose.position.y = current_ee_tf.transform.translation.y;
target_pose.pose.position.z = current_ee_tf.transform.translation.z;
target_pose.pose.orientation = current_ee_tf.transform.rotation;
// Modify it a little bit
target_pose.pose.position.x += 0.01;
// resetTargetPose() can be used to clear the target pose and wait for a new one, e.g. when moving between multiple
// waypoints
tracker.resetTargetPose();
// Publish target pose
target_pose.header.stamp = ros::Time::now();
target_pose_pub.publish(target_pose);
// Run the pose tracking in a new thread
std::thread move_to_pose_thread(
[&tracker, &lin_tol, &rot_tol] { tracker.moveToPose(lin_tol, rot_tol, 0.1 /* target pose timeout */); });
ros::Rate loop_rate(50);
while(ros::ok())
{ std_msgs::Float64MultiArray val = listener.aruco_data;
if (!val.data.empty()) {
// Modify the pose target a little bit each cycle
// This is a dynamic pose target
target_pose.pose.position.x = current_ee_tf.transform.translation.x;
std::cout << "Current position is " << target_pose.pose.position.x << std::endl;
target_pose.pose.position.x += val.data.at(0);
std::cout << "Tareget position in x is " << val.data.at(0) << std::endl;
target_pose.header.stamp = ros::Time::now();
target_pose_pub.publish(target_pose);
std::cout << "Message has been published" << std::endl;
loop_rate.sleep();
}
else{
std::cout << "data is not received" << std::endl;
loop_rate.sleep();
}}
// Make sure the tracker is stopped and clean up
tracker.stopMotion();
move_to_pose_thread.join();
return EXIT_SUCCESS;
}
Any suggestions on which way I should go about tweaking the kinematics.yaml as I think going too far in terms of attempts and timeout can bring some latency
kinematics_solver_search_resolution: 0.005 kinematics_solver_timeout: 0.005 kinematics_solver_attempts: 3
I want to follow the aruco marker to perform visual servoing. Any help/ suggestion would be much appreciated.
Read up on the available bio_ik parameters here:
https://github.com/TAMS-Group/bio_ik
The ones you posted above seem fine to me.
Thank you @AndyZe for your help. Arm is moving now seems like needed to remove one line in the loop
target_pose.pose.position.x = current_ee_tf.transform.translation.x;
causing the problem, I am still not sure why but It's fine.
I am closing this issue as it has been solved. If the problem persists, please comment and the issue will be reopened if appropriate.
Hey I'm trying to use moveit_servo to track an aruco marker as well and it's not working as well as I would want it to.
Do you have any suggestions to help the arm reach the target marker ?
@ManasviniSrini , can you please elaborate on where you are getting stuck and what is the error you are getting now?
Hi, I am using MoveitServoing on real arm to track a fiduciary marker, however it stops in between and keeps on complaining about
Very close to a singularity, emergency stop
. I have already used bio_ik as suggested and also increased it to 100hard_stop_singularity_threshold: 100.0 # Stop when the condition number hits this
I am using xarm6
Kinematics.yaml
config.yaml
I am not sure where I am doing wrong. As I have seen people using these techniques to resolve this problem. My goal is to achieve visual servoing.