First GUI template
Because of the final exams in the first week, I actually started working since this Tuesday. Thanks for my mentor’s understanding again!
In last meeting, we planed to start with making a GUI template for all the exercises I am going to develop for this project. This template will need to include robot teleoperator, code management part, camera viewer and scene viewer.
Before makeing GUI, I tested several provided ROS rqt plugins, but only one of them might be useful for us. With “rqt_moveit” plugin, we can only monitor following informations:
Node: /move_group
Parameter: /robot_description, /robot_description_semantic
Topic: sensor_msgs/PointCloud, sensor_msgs/PointCloud2, sensor_msgs/Image, sensor_msgs/CameraInfo
With “rqt_rviz” plugin, we load rviz interface, so it is exactly the same as launching rviz. The only useful one is rqt_joint_trajectory_controller. We can choose controller group and change robot joints angle with it. An example interface is shown below.
To develop GUI with python, I learned PyQt5 and used Qt designer to make a draft GUI as shown below. Currently, the camera viewer is connected with kinect camera topic, but the other parts still don’t connect with the robot.
More Stable pick and place in Gazebo
Though both parallel gripper and vacuum gripper pick and place demo can work, they are still unstable as I mentioned in last blog. I mainly worked on the parallel gripper this week. It can grasp object much more stable than last week with some modifications in gazebo_grasp_fix plugin and related manually chosen parameters.
Modification of gazebo_grasp_fix plugin and parameters tuning
In last demo, we can only see that sometimes the plugin doesn’t detact a grasp between gripper and object, so object cannot be picked up. I tried to change the provided variables, but it can just provide limited improvement. To have a better understanding of what is going on inside the plugin, I took a look of the source code of it. Some output are added to have a better understanding about why the plugin sometimes cannot grasp the object.
forces_angle_tolerance
By printing out some internal variable values, I found that it can detect contact between gripper finger and object, but the angle between two detected force vector is usually smaller than 90 degree, so no gripping behavior is identified. It may cost too much time to dig out how Gazebo compute contact vector, so finally I decide to remove the minimum 90 degree limitation in source code and use 80 degree as threshold angle.
update_rate and grip_count_threshold
Another important parameter group is grip_count_threshold and update rate. Though I made the threshold degree smaller, the inaccurate contact force angle was still usually smaller than it. However, by reducing update rate to 2Hz and grip_count_threshold to 1, which means the plugin will check contact two times within one second, if one of them is detected as gripping, the object will be fixed to the gripper, the suceess gripping rate increases.
The original plugin requires that the number of detected grip is more than grip_count_threshold, which requires at least two detected grips, but we usually can only detect one grip, so I change “<” to “<=”.
gripper joint moving distance
The last significant parameter is how much the gripper close when grasping object which should be tuned according to the object size. For example, with a 4cm-thick box, 0 means fully open and 1 means fully closed, 0.46 is the best value to grasp the box. When using value smaller than 0.46, there would be no contact between fingers and object. When using value larger than 0.46, because the gripper joint is set as a spring-like object, it may cause the contact force vector more unstable. I also tried to use pick and place function in MoveIt to see if it can help to choose a proper gripping value. However, when the gripper finger is closed to object, the objected is already identified as gripped in MoveIt, even no contact force is detected to fix the object to the gripper.
In conclusion, by reducing forces_angle_tolerance, update_rate and grip_count_threshold to a proper value, and tuning the gripping closing distance properly, we can increase the stability of grasping in Gazebo which seems to be good enough for our exercise.