Writing /var/lib/dokuwiki/data/meta/tutorials/object_manipulation_robot_simulator.meta failed
tutorials:object_manipulation_robot_simulator
Differences
This shows you the differences between two versions of the page.
tutorials:object_manipulation_robot_simulator [2019/10/11 23:45] – [Changing robot base position/orientation] admin | tutorials:object_manipulation_robot_simulator [2022/09/20 00:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 415: | Line 415: | ||
* Press the green button with " | * Press the green button with " | ||
- | ==== Starting the vfclik system for the real robot (ROBIO 2019 experiments). Only runs on the right arm/hand ==== | + | ==== Starting the vfclik system for the real robot (AAMAS 2019 experiments). Only runs on the right arm/hand ==== |
Line 438: | Line 438: | ||
cd ~/local/src | cd ~/local/src | ||
- | vfclik -n / | + | vfclik -n / |
* Visualization (pyrovito): | * Visualization (pyrovito): | ||
Line 494: | Line 494: | ||
torque_sim -b / | torque_sim -b / | ||
- | * Adjust the desired fingers to calibrate | + | * Adjust the desired fingers to calibrate |
- | * Prepare a small bottle | + | * Prepare a small " |
* Run the hand_calibration.py script: | * Run the hand_calibration.py script: | ||
Line 501: | Line 501: | ||
./ | ./ | ||
- | * Follow the instructions of the script. Be sure to disconnect or " | + | * Follow the instructions of the script. Be sure to disconnect or " |
* When the script is " | * When the script is " | ||
* Annotate the torque and angle calibration values. | * Annotate the torque and angle calibration values. | ||
Line 509: | Line 509: | ||
* Run again sahand_yarp_sim and torque_sim. This will apply the new calibration values to the estimated forces. | * Run again sahand_yarp_sim and torque_sim. This will apply the new calibration values to the estimated forces. | ||
* Remember to flex the finger joints to a prudent value to avoid a singularity and get better force estimations. | * Remember to flex the finger joints to a prudent value to avoid a singularity and get better force estimations. | ||
- | * Remember to offset | + | * Remember to zero the finger torques every time you reorient the hand. The finger impedance control doesn' |
* You can run hand_calibration.py again until the fingers are flexed and the torques are zeroed to test the new calibration values. | * You can run hand_calibration.py again until the fingers are flexed and the torques are zeroed to test the new calibration values. | ||
+ | === Camera calibration === | ||
+ | The usual steps for setting up a system with a camera with marker detection consists: | ||
+ | |||
+ | * Install ROS modules (camera module, rectification module, marker detection module) | ||
+ | * Calibrate the camera intrinsics | ||
+ | * Measure the arm_base-to-camera_base transform. Since this is done totally manually, this is usually pretty wrong. | ||
+ | * Run a arm_base-to-camera_base calibration to obtain the corrected arm_base-to-camera_base transform. | ||
+ | * Set a launch file for running the camera module, together with a rectification module, together with an static transform representing the arm_base-to-camera_base transform. | ||
+ | * Use a ros to yarp bridge to send the marker poses to yarp. | ||
+ | |||
+ | |||
+ | == Install ROS1 modules == | ||
+ | |||
+ | * We use a realsense sensor. Our sensor has a full-HD RGB camera which we are using. | ||
+ | * We detected a problem with the brightness adjustment of the camera: the brightness oscillates erratically. We deal with this problem by stopping the ROS realsense module, running the realsense-viewer, | ||
+ | * We have a launch file for our realsense camera in the following repository: | ||
+ | |||
+ | git clone git@git.arcoslab.org: | ||
+ | |||
+ | * You can run this configuration with: | ||
+ | |||
+ | roslaunch oms_launcher rs_camera.launch | ||
+ | |||
+ | * Check this launch file for relevant camera settings | ||
+ | * We use ROS1 with a module " | ||
+ | |||
+ | == Calibrate camera intrinsics == | ||
+ | |||
+ | * The purpose of this step is to rectify the image coming from the camera. Usually there is some degree of image distortion with any lenses. This is possible to counteract with image_proc ROS module. | ||
+ | * You can use the camera calibration toolset from ROS1: | ||
+ | |||
+ | http:// | ||
+ | |||
+ | * After finding a way to deactivate the realsense module intrinsic internal rectification we ran a full camera calibration and found out that the included realsense calibration is quite good. This step is not necessary with this camera. | ||
+ | * If you have a camera that needs this calibration, | ||
+ | |||
+ | == Run a arm_base-to-camera_base calibration == | ||
+ | |||
+ | * For this type of calibration we used the ROS1 module: robot_cal_tools | ||
+ | |||
+ | https:// | ||
+ | |||
+ | * This module is robot independent and is not too complicated to use | ||
+ | * In our oms-cylinder ROS module take a look at the static_calibration.launch and its internal configuration files | ||
+ | * These are the main steps to follow to execute a camera_base calibration: | ||
+ | * Mount rigidly a the calibration panel to the arms end-effector | ||
+ | * Mount rigidly the camera to the robot (this can't change after calibration!) | ||
+ | * Write and run a script that moves the end-effector in the picture space. Be sure to navigate to very disperse 6D areas of the picture space. Try strong rotations but still camera visible. Try this rotations if far away x,y,z points. Also try the same in some center areas of the picture. It is possible to calibration the camera_base with positions. This script has to move the end-effector to these positions and then capture an image in each of them. Be sure to stop the arm completely, if not, the image can be blurred and the calibration table can be incorrectly detected. You need to store the corresponding image file and a yaml file that points to the corresponding image. This yaml file includes the end-effector position. | ||
+ | * With the images and end-effector positions now you can run the robot_cal_tools calibrator. If it converges it will give an estimated camera_base transform. You will need this transform for the next main step. | ||
+ | |||
+ | == Set a launch file for running the camera module, together with a rectification module, together with an static transform representing the arm_base-to-camera_base transform. == | ||
+ | |||
+ | * In oms-cylinder repository use the following two launch files to incorporate the camera_to_arm_base transform found in the previous step: | ||
+ | |||
+ | oms_launcher_marker90.launch | ||
+ | ar_oms_cylinder_marker90.launch | ||
+ | |||
+ | * You can use this launch file to run the system once the calibration is satisfactory | ||
+ | |||
+ | |||
+ | == Ros to yarp bridge == | ||
+ | |||
+ | * The ROS oms-cylinder module has a ros_to_yarp script to send the markers poses to yarp. Find it in: | ||
+ | |||
+ | cd ar_pose_marker_yarp_bridge/ | ||
+ | ./ | ||
+ | |||
+ | * The webcam_calibration_values.py file is for now ignored. You will need to put a camera_pose homomatrix array (identity) though. This file was used in case you didn't use a static_transform in the camera launch modules for the camera_base transform. | ||
+ | * The object_params.py file contains self.markers_transformations dictionary. There you have to configure an static transformation for you object of interest (a box has the marker attached on one side, you can add a static transform to set the markers yarp data to that position). | ||
+ | * This yarp module will publish marker data in the / | ||
+ | * You can use the -f option to do a " | ||
+ | |||
+ | === Finger tip pushing calibration === | ||
+ | |||
+ | Once you followed the [[tutorials: | ||
+ | a marker to the fingertip of the selected pushing finger. Then orient the hand (using run_right.sh "/ | ||
+ | |||
+ | Step-by-step instructions: | ||
+ | |||
+ | * Run the ros_to_yarp marker bridge without any object transform: | ||
+ | |||
+ | cd ar_pose_marker_yarp_bridge/ | ||
+ | ./ | ||
+ | |||
+ | * This will give the pure marker pose with no extra object transforms. | ||
+ | * Edit the webcam_calibration_values.py file. Set rel_pose_marker_finger transform to an identity homomatrix. | ||
+ | * Set the finger_pushing_pos joint angles in the exploration.py file to select your desired finger pushing configuration. | ||
+ | * Glue a marker to an object of interest. | ||
+ | * Position the object on a reachable pose on top of a table. | ||
+ | * Run exploration.py | ||
+ | |||
+ | cd local/ | ||
+ | ./ | ||
+ | |||
+ | * Follow the program instructions until this appears: | ||
+ | |||
+ | < | ||
+ | Getting initial object position | ||
+ | Box global pose [[ 0.99903308 | ||
+ | | ||
+ | [ 0.04315164 | ||
+ | [ 0. 0. 0. 1. ]] | ||
+ | If right, press " | ||
+ | </ | ||
+ | |||
+ | * If the position looks file press y and enter. The robot should move the finger behind the object with the fingertip aligned to the marker of the object (more or less). | ||
+ | * Remove the object. (hide this marker) | ||
+ | * Glue a marker to the finger tip. | ||
+ | * Ctrl-C (cancel) exploration.py | ||
+ | * Using run_right.sh / | ||
+ | * Get the finger_tip pose and the marker pose: | ||
+ | * In one console run (To_m): | ||
+ | |||
+ | yarp read ... / | ||
+ | |||
+ | * In another console run (To_f): | ||
+ | |||
+ | yarp read ... / | ||
+ | |||
+ | * Anotate both homomatrix. Calculate Tf_m =((To_f)^-1)*To_m | ||
+ | * Use Tf_m in webcam_calibration_values.py file with the rel_pose_marker_finger variable. | ||
+ | * Run exploration.py again. Check that the pushing orientation is the desired one. | ||
+ | |||
+ | === Exploring for the object parameters === | ||
+ | |||
+ | ./ | ||
==== Running in simulation the same conf as in real life ==== | ==== Running in simulation the same conf as in real life ==== | ||
Line 646: | Line 772: | ||
===== Changing robot base position/ | ===== Changing robot base position/ | ||
+ | |||
+ | ==== Changes in KRC ==== | ||
+ | |||
* Physically relocate the robot in the new designated place. | * Physically relocate the robot in the new designated place. | ||
Line 672: | Line 801: | ||
* Start the FRIControl file as you normally do. Check that the initial position is as desired | * Start the FRIControl file as you normally do. Check that the initial position is as desired | ||
+ | ==== Changes in Linux software ==== | ||
+ | |||
+ | Review: | ||
+ | |||
+ | * Change fri interface last two joint limits (in case hand mounting position changed) | ||
+ | * Change VFClik initial joint and frame positions | ||
+ | * Change VFClik last two joint limits (in case hand mounting position changed) | ||
+ | * Update arm kinematic chain (arm base and hand base) | ||
+ | |||
+ | === VFClik initial joint and frame positions === | ||
+ | |||
+ | * Edit file: | ||
+ | < | ||
+ | * Adjust initial_joint_pos (use the ones from the fri KRC initial joint positions) | ||
+ | * | ||
tutorials/object_manipulation_robot_simulator.1570837502.txt.gz · Last modified: 2022/09/20 00:08 (external edit)