Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
tutorials:object_manipulation_robot_simulator [2019/06/14 23:36]
dgarcia [DLR HIT II]
tutorials:object_manipulation_robot_simulator [2019/11/13 21:07]
admin [Starting the vfclik system for the real robot (AAMAS 2019 experiments). Only runs on the right arm/hand]
Line 24: Line 24:
   ** For Debian Stretch and newer:   ** For Debian Stretch and newer:
  
-   sudo apt-get install python-numpy python-scipy python-opengl python-pygame python-matplotlib python-sip python-sip-dev python-qt4-dev python-qt4 python-gtk2 python-gtk2-dev python-vtk6 python-pyvtk python-gtkglext1 libeigen3-dev python-yaml python-setuptools python-future python-colorlog+   sudo apt install python-numpy python-scipy python-opengl python-pygame python-matplotlib python-sip python-sip-dev python-qt4-dev python-qt4 python-gtk2 python-gtk2-dev python-vtk6 python-pyvtk python-gtkglext1 libeigen3-dev python-yaml python-setuptools python-future python-colorlog
  
   * Install Yarp [[installing_yarp_in_debian|Installing YARP in debian]]   * Install Yarp [[installing_yarp_in_debian|Installing YARP in debian]]
Line 31: Line 31:
  
 <code bash simulator_installer.sh>​ <code bash simulator_installer.sh>​
-  ​#install avispy +#install avispy 
-  echo "​install avispy"​ +echo "​install avispy"​ 
-  cd $HOME/​local/​src +cd $HOME/​local/​src 
-  git clone https://​gitlab.com/​arcoslab/​avispy.git +git clone https://​gitlab.com/​arcoslab/​avispy.git 
-  cd avispy +cd avispy 
-  make xstow_install +make xstow_install 
-   + 
-  #install roboview +#install roboview 
-  echo "​install roboview"​ +echo "​install roboview"​ 
-  cd $HOME/​local/​src +cd $HOME/​local/​src 
-  git clone https://​gitlab.com/​arcoslab/​roboview.git +git clone https://​gitlab.com/​arcoslab/​roboview.git 
-  cd roboview +cd roboview 
-  make xstow_install +make xstow_install 
-   + 
-  #install cmoc +#install cmoc 
-  echo "​install cmoc"​ +echo "​install cmoc"​ 
-  cd $HOME/​local/​src +cd $HOME/​local/​src 
-  git clone https://​gitlab.com/​arcoslab/​cmoc.git +git clone https://​gitlab.com/​arcoslab/​cmoc.git 
-  cd cmoc +cd cmoc 
-  make xstow_install +make xstow_install 
-   + 
-  #install pyrovito +#install pyrovito 
-  echo "​install pyrovito"​ +echo "​install pyrovito"​ 
-  cd $HOME/​local/​src +cd $HOME/​local/​src 
-  git clone https://​gitlab.com/​arcoslab/​pyrovito.git +git clone https://​gitlab.com/​arcoslab/​pyrovito.git 
-  cd pyrovito +cd pyrovito 
-  make xstow_install +make xstow_install 
-   + 
-  #install vfl +#install vfl 
-  echo "​vfl"​ +echo "​vfl"​ 
-  cd $HOME/​local/​src +cd $HOME/​local/​src 
-  git clone https://​gitlab.com/​arcoslab/​vfl.git +git clone https://​gitlab.com/​arcoslab/​vfl.git 
-  cd vfl +cd vfl 
-  make xstow_install +make xstow_install 
-   + 
-  #install vfclick +#install vfclick 
-  echo "​install vfclick"​ +echo "​install vfclick"​ 
-  cd $HOME/​local/​src +cd $HOME/​local/​src 
-  git clone https://​gitlab.com/​arcoslab/​vfclik.git +git clone https://​gitlab.com/​arcoslab/​vfclik.git 
-  cd vfclik +cd vfclik 
-  make xstow_install +make xstow_install 
-   + 
-  #install kdb cart cmd +#install kdb cart cmd 
-  echo "​install kdb cart cmd" +echo "​install kdb cart cmd" 
-  cd $HOME/​local/​src +cd $HOME/​local/​src 
-  git clone https://​gitlab.com/​arcoslab/​kbd-cart-cmd.git +git clone https://​gitlab.com/​arcoslab/​kbd-cart-cmd.git 
-  cd kbd-cart-cmd +cd kbd-cart-cmd 
-  make xstow_install +make xstow_install 
-   + 
-  #install arcospyu +#install arcospyu 
-  echo "​install arcospyu"​ +echo "​install arcospyu"​ 
-  cd $HOME/​local/​src +cd $HOME/​local/​src 
-  git clone https://​gitlab.com/​arcoslab/​arcospyu.git +git clone https://​gitlab.com/​arcoslab/​arcospyu.git 
-  cd arcospyu +cd arcospyu 
-  make xstow_install +git checkout 0.1.2 
-   +make xstow_install 
-  #​robot_descriptions + 
-  echo "​robot_descriptions"​ +#​robot_descriptions 
-  cd $HOME/​local/​src +echo "​robot_descriptions"​ 
-  git clone https://​gitlab.com/​arcoslab/​robot_descriptions.git+cd $HOME/​local/​src 
 +git clone https://​gitlab.com/​arcoslab/​robot_descriptions.git
 </​code>​ </​code>​
  
Line 120: Line 121:
   pyrovito -r lwr --arm_right --arm_left --hand_right --hand_left -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -d robot_descriptions/​arcosbot/​kinematics/​sahand/​   pyrovito -r lwr --arm_right --arm_left --hand_right --hand_left -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -d robot_descriptions/​arcosbot/​kinematics/​sahand/​
  
-  * In another console execute torque simulator:+  * In another console execute torque simulator ​(only working with left arm/hand):
  
   cd ~/local/src   cd ~/local/src
-  torque_sim -s -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -c robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py+  torque_sim ​-r -s -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -c robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py
  
   * To test the system, in another console send forces to finger tips:   * To test the system, in another console send forces to finger tips:
  
-  rlwrap yarp write ... /​torque_sim/​force_in+  rlwrap yarp write ... /0/​torque_sim/​force_in
   (1 -2. 0. 0.)   (1 -2. 0. 0.)
   (1 0. 0. 0.)   (1 0. 0. 0.)
Line 218: Line 219:
 === KRC === === KRC ===
  
-Check that you have FRI properly installed. In case that there are network communication problems some times there is a problem with the network card installation. The KRC has two network cards, one for Windows and one for VXworks. To be sure that the one for VXWorks is properly installed, go to control-panel->​ Device Manager, and check that the PCI network controller is listed under "​Realtime OS Devices"​ and not under "​Network Adapters"​. If it is under "​Network Adapters"​ it means windows has "​claimed"​ it. To reassign it to VXWorks, insert the FRI installation CD and go to INTERNAT\KRCUPD directory and run "​KsNetCfg.exe"​. This will install again the VXWorks network adapter card. This is usually a problem with the Intel Pro1000 GT card. Reboot and reconfigure FRI ini files.+Check that you have FRI properly installed. In case that there are network communication problems some times there is a problem with the network card installation. The KRC has two network cards, one for Windows and one for VXworks. To be sure that the one for VXWorks is properly installed, go to control-panel->​System->​Hardware->Device Manager, and check that the PCI network controller is listed under "​Realtime OS Devices"​ and not under "​Network Adapters"​. If it is under "​Network Adapters"​ it means windows has "​claimed"​ it. To reassign it to VXWorks, insert the FRI installation CD and go to INTERNAT\KRCUPD directory and run "​KsNetCfg.exe"​. This will install again the VXWorks network adapter card. This is usually a problem with the Intel Pro1000 GT card. Reboot and reconfigure FRI ini files.
  
 === Linux Installation === === Linux Installation ===
Line 236: Line 237:
  
   sudo apt-get install g++-multilib   sudo apt-get install g++-multilib
 +
 +Give suid permissions to LWR_yarp_arcos fri-yarp bridge to allow it to run using preemptive realtime scheduling:
 +
 +  cd ~/​local/​src/​fri-stanford/​Linux/​x64/​release/​bin
 +  sudo chown root: LWR_yarp_arcos
 +  sudo chmod u+s LWR_yarp_arcos
  
 === Gravity === === Gravity ===
Line 241: Line 248:
 Please check that the gravity vector is correctly configured. After you have selected the current payload (configure->​set_tool/​base->​tool_no/​base_no),​ go to monitor->​variable->​single and introduce in "​name":​ $torque_tcp_est. Press shift-enter to have realtime variable updates. They should show small values No more than 5 Newtons in x,y or z. If they are big, this usually means, that either the payload is not properly selected, or that the gravity vector is incorrect. Please check that the gravity vector is correctly configured. After you have selected the current payload (configure->​set_tool/​base->​tool_no/​base_no),​ go to monitor->​variable->​single and introduce in "​name":​ $torque_tcp_est. Press shift-enter to have realtime variable updates. They should show small values No more than 5 Newtons in x,y or z. If they are big, this usually means, that either the payload is not properly selected, or that the gravity vector is incorrect.
  
-To check the current gravitation vector monitor->​variable->​single in "​name":​ $gravitation[]. To permanently change the gravitation values, edit file : c:​\krc\roboter\krc\steu\mada\$custom.datAt the beginning of the file you will find the variable values.+To check the current gravitation vector monitor->​variable->​single in "​name":​ $gravitation[]. To permanently change the gravitation values, edit file :  
 +<​file>​c:​\krc\roboter\krc\steu\mada\$custom.dat</​file>​ 
 +At the beginning of the file you will find the variable values.
  
 ==== Running ==== ==== Running ====
Line 366: Line 375:
 === Running the FRI-yarp bridge === === Running the FRI-yarp bridge ===
  
-  * Run FRI-yarp server-bridge:+  * If you configured LWR_yarp_arcos with suid: 
 + 
 +  cd ~/​local/​src/​fri_stanford/​Linux/​x64/​release/​bin 
 +  ./​LWR_yarp_arcos 
 + 
 +  * If you didn't use suid:
  
   cd ~/​local/​src/​fri_stanford/​Linux/​x64/​release/​bin   cd ~/​local/​src/​fri_stanford/​Linux/​x64/​release/​bin
Line 386: Line 400:
     * Configure->​Set tool/​base-> ​  Tool no: 1(empty) 2(hand) 3(L link), base no: 1     * Configure->​Set tool/​base-> ​  Tool no: 1(empty) 2(hand) 3(L link), base no: 1
     * With the file manager, go to: R1/​Program/​FRIDemo/​     * With the file manager, go to: R1/​Program/​FRIDemo/​
-    * Select file FRIControl+    * Select file FRIControl ​  (this file is in the KRL/​ARCOS-Lab_KRC1/​FRIDemo/​ repository directory. You must internally check for the gravity vector and the tool number to be correct)
     * Select Position Control with LWR button     * Select Position Control with LWR button
     * Monitor->​Variable->​Single->​Name:​ $torque_tcp_est ​ (check that torques and forces don't exceed a value of 2)     * Monitor->​Variable->​Single->​Name:​ $torque_tcp_est ​ (check that torques and forces don't exceed a value of 2)
Line 401: Line 415:
   * Press the green button with "​+"​ several times until FRI switches to joint impedance control. During this the arm moves to the starting position and then to the last commanded position. Beware!!!!   * Press the green button with "​+"​ several times until FRI switches to joint impedance control. During this the arm moves to the starting position and then to the last commanded position. Beware!!!!
  
-==== Starting the vfclik system for the real robot ====+==== Starting the vfclik system for the real robot (AAMAS 2019 experiments). Only runs on the right arm/​hand ​==== 
 + 
  
   * Remember to start the FRI yarp bridge first (look above)   * Remember to start the FRI yarp bridge first (look above)
-  * Remember to change robot_descriptions branch ​to fri-integration+  * Remember to check to following repositories to the tag "​robio_2019_right_arm_hand_forces"​ 
 +  * gitlab:
  
-  ​cd ~/​local/​src/​robot_descriptions +  ​arcospyu avispy cmoc kbd-cart-cmd orocos-kdl pyrovito ​robot_descriptions ​vfclik vfl 
-  git checkout ​fri-integration+ 
 +  ​git.arcoslab.org:​ 
 + 
 +  ​fri-stanford hand-code 
 + 
 +  * For yarp use the following git commit: 
 + 
 +  ced5964df3e730fe5d578e044277f69665b95a1f 
 + 
 +=== Running the ARM software ===
  
   * VFCLIK:   * VFCLIK:
  
   cd ~/local/src   cd ~/local/src
-  vfclik -lwr -i right -d robot_descriptions/​arcosbot/​kinematics/​lwr/​ +  vfclik -n /​arcosbot-real -r lwr -i right -d robot_descriptions/​arcosbot/​kinematics/​lwr/​
  
   * Visualization (pyrovito):   * Visualization (pyrovito):
  
   cd ~/local/src   cd ~/local/src
-  pyrovito -r lwr --arm_right --hand_right -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -d robot_descriptions/​arcosbot/​kinematics/​sahand/​ +  pyrovito ​-n /​arcosbot-real ​-r lwr --arm_right --hand_right -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -d robot_descriptions/​arcosbot/​kinematics/​sahand/​
  
   * Joint limits visualization:​   * Joint limits visualization:​
Line 425: Line 449:
   cd ~/local/src   cd ~/local/src
   bar_vis   bar_vis
-  yarp connect /​lwr/​right/​debug/​qdist /​bar_vis/​bar/​in+  yarp connect ​/​arcosbot-real/​lwr/​right/​debug/​qdist /​bar_vis/​bar/​in
  
   * Keyboard control:   * Keyboard control:
  
-  run_right.sh+  run_right.sh ​"/​arcosbot-real"​
  
   * To control nullspace movement:   * To control nullspace movement:
  
-  yarp write ...  /​lwr/​right/​nullspace/​control+  yarp write ...  ​/​arcosbot-real/​lwr/​right/​nullspace/​control
  
 In this console you can write nullspace speed movements. Try small numbers like 0.1 first. In this console you can write nullspace speed movements. Try small numbers like 0.1 first.
  
 +=== Running the HAND acquisition and force estimation ===
  
 +  * Start the ardnet system, and the ardnet/yarp bridge (hand_yarp):​
  
 +  cd ~/​local/​src/​hand-code/​hand_yarp
 +  ./​python/​wessling_hand/​start_ard.py ​
  
-====This is a work in progress!==== +  * Disable ​and enable the hand fingers (using the hand emergency stop button) 
-Make sure to checkout fri-integration in robot-descriptions ​and cmoc.+  * Start the real/sim hand bridge:
  
-  ​vfclik ​-i lwr -i right -d robot_descriptions/​arcosbot/​kinematics/​lwr/​ -s +  ​cd ~/​local/​src 
-  sahand_yarp_sim ---r -n -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py +  sahand_yarp_sim ​-b /arcosbot-real -r -d -n -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py 
-  ​pyrovito ​-r lwr --arm_right --hand_right ​-a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -robot_descriptions/​arcosbot/​kinematics/​sahand/​ + 
-  torque_sim ​-s -a robot_descriptions/​arcosbot/​kinematics/​lwr/ -c robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py -r +  * Torque fingertip estimation:​ 
-  run_right.sh + 
-  ​python ​~/​local/​src/​cmoc/​robot/tests/fith_finger_tester.py --c ~/​local/​src/​robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py -f ~/​local/​src/​robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py+  cd ~/​local/​src 
 +  torque_sim -b /​arcosbot-real -r -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -c robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py 
 + 
 +  * Now you should see yellow arrows representing the forces on the fingertips. 
 + 
 + 
 +=== Hand torque sensor calibration === 
 + 
 +  * If you are running a previous sahand_yarp_sim and torque_sim please stop them. 
 +  * Check that your finger_calibration_data.py file is linking to finger_calibration_data_unit.py file 
 +  * Start sahand_yarp_sim and torque_sim again (but with no calibration data (unit file above): 
 + 
 +  cd ~/local/src 
 +  sahand_yarp_sim -b /arcosbot-real -r -d -n -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py 
 + 
 +  ​cd ~/​local/​src 
 +  torque_sim ​-b /arcosbot-real --a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py ​-robot_descriptions/​arcosbot/​kinematics/​sahand/hands_kin.py 
 + 
 +  * Adjust the desired fingers to calibrate in the finger variable in hand_calibration.py file 
 +  * Prepare a small "​weight object"​ for calibration purposes with a previously measured weight. We recommend using a small bottle filled with water. Remember that the fingers can't lift something too heavy. Use 200grams. 
 +  * Run the hand_calibration.py script: 
 + 
 +  cd ~/​local/​src/​hand-code/​hand_yarp/​python/​wessling_hand 
 +  ./​hand_calibration.py -b /​arcosbot-real ​-c ~/​local/​src/​robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py -f ~/​local/​src/​robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py -a ~/​local/​src/​robot_descriptions/​arcosbot/​kinematics/​lwr/​ 
 + 
 +  ​* Follow the instructions of the script. Be sure to disconnect or "​lift"​ the finger connected weight when the script is zeroing sensor'​s torques. Be sure to connect, to the corresponding finger, the bottle when indicated. 
 +  * When the script is "​looping",​ ctrl-c it !!! (Stop it) 
 +  * Annotate the torque and angle calibration values. 
 +  * Create a new finger_calibration_data_something.py by copying the finger_calibration_data_unit.py file. 
 +  * Modify the new finger_calibration_data_something.py file with the new annotated torque and angle calibration values. 
 +  * Link finger_calibration_data.py to the new file. 
 +  * 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 zero the finger torques every time you reorient the hand. The finger impedance control doesn'​t have gravity weight compensation,​ therefore, the finger weight affects the measurement greatly. 
 +  * 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,​ deactivating all the auto-exposure and auto-brightness features, stopping the realsense-viewer and then running again the ROS realsense module.  
 +  * We have a launch file for our realsense camera in the following repository:​ 
 + 
 +  git clone git@git.arcoslab.org:​humanoid-software/​oms-cylinder.git 
 + 
 +  * 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 "​ar_pose"​ to detect object'​s position and orientation. Follow typical ROS1 procedures to install this module (works in melodic and Ubuntu Bionic) 
 + 
 +== 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://​wiki.ros.org/​camera_calibration 
 + 
 +  * 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,​ you will need to configure the camera intrinsics in the camera module somehow (some modules can't do this, beware!). Then you will need to connect the camera output to image_proc. This will create an /image_rect topic with the rectified image. 
 + 
 +== Run a arm_base-to-camera_base calibration == 
 + 
 +  * For this type of calibration we used the ROS1 module: robot_cal_tools 
 + 
 +  https://​github.com/​Jmeyer1292/​robot_cal_tools 
 + 
 +  * 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/​scripts 
 +  ./​ros_to_yarp_box_pose.py -w ~/​local/​src/​robot_descriptions/​arcosbot/​perception/​webcam_calibration_values.py -o ~/​local/​src/​cmoc/​objects/​sliding/​objects/​object_params.py 
 + 
 +  * 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 /​arcosbot-real/​marker/​object_pos:​o port 
 +  * You can use the -f option to do a "​finger_testing"​ run. This will disable the objects transforms and it will give a pure marker position. This will be useful for the the next tutorial part. 
 + 
 +=== Finger tip pushing calibration === 
 + 
 +Once you followed the [[tutorials:​object_manipulation_robot_simulator#​hand_torque_sensor_calibration|#​hand_torque_sensor_calibration]],​ you will have one or more fingers for exerting forces against objects. Now we will assume that you will use one finger to push an object. Once you selected the particular finger you will need to find a particular hand orientation to push the object to avoid table crashes or other parts of the hand to crash against the object itself. A trick to get this easier is to glue  
 +a marker to the fingertip of the selected pushing finger. Then orient the hand (using ​run_right.sh ​"/​arcosbot-real"​) in the desired pushing orientation. Command the fingers to a finger pushing configuration. Glue the marker to the finger tip. Adjust the marker such that it is vertical in orientation (to match the markers that are glued to other objects). Get the current marker pose (To_m), get the current finger global pose (To_f), calculate the fingertip-to-marker homo transform (Tt_m=((To_t)^-1)*To_m). Use this transform in the robot_descriptions/​arcosbot/​perception/​webcam_calibration_values.py file with the rel_pose_marker_finger variable. 
 + 
 +Step-by-step instructions:​ 
 + 
 +  ​* Run the ros_to_yarp marker bridge without any object transform:​ 
 + 
 +  cd ar_pose_marker_yarp_bridge/​scripts 
 +  ./​ros_to_yarp_box_pose.py -w ~/​local/​src/​robot_descriptions/​arcosbot/​perception/​webcam_calibration_values.py -o ~/​local/​src/​cmoc/​objects/sliding/objects/​object_params.py -
 + 
 +  * 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/​src/​cmoc/​objects/​sliding/​scripts/​ 
 +  ./​exploration.py -n /​arcosbot-real ​-c ~/​local/​src/​robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py -o ~/​local/​src/​cmoc/​objects/​sliding/​objects/​object_params.py -f ~/​local/​src/​robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py ​-w ~/​local/​src/​robot_descriptions/​arcosbot/​perception/​webcam_calibration_values.py 
 + 
 +  * Follow the program instructions until this appears: 
 + 
 +<​code>​ 
 +Getting initial object position 
 +Box global pose [[ 0.99903308 ​ 0.00634678 -0.04350436 ​ 0.63601302] 
 + ​[-0.00841706 ​ 0.99883239 -0.04757109 ​ 0.25734383] 
 + [ 0.04315164 ​ 0.04789128 ​ 0.99792002 ​ 0.85763204] 
 + [ 0.          0.          0.          1.        ]] 
 +If right, press "​y"​ 
 +</​code>​ 
 + 
 +  * 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 /​arcosbot-real rotate the end-effector until the pushing orientation is found. Adjust the glued marker such that the orientation of the marker is the some as the orientation that the object previously had. 
 +  * Get the finger_tip pose and the marker pose: 
 +    * In one console run (To_m): 
 + 
 +  yarp read ... /​arcosbot-real/​marker/​object_pos:​o 
 + 
 +    * In another console run (To_f): 
 + 
 +  yarp read ... /​arcosbot-real/​lwr/​right/​vectorField/​pose 
 + 
 +  * 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. 
 + 
 + 
 +==== Running in simulation the same conf as in real life ==== 
 + 
 +This part of the tutorial is useful when you want to run the simulator using the same hardware and configuration that is available right now in "real life". Make sure to use the correct tag as stated in the **Starting the vfclik system for the real robot (ROBIO 2019 experiments). Only runs on the right arm/hand** section. Each line of the following code block should be run in a separate terminal at ''​~/​local/​src/''​. 
 + 
 +  vfclik -s -n /​arcosbot-real -i lwr -i right -d robot_descriptions/​arcosbot/​kinematics/​lwr/​ 
 +  pyrovito -n /​arcosbot-real -r lwr --arm_right --hand_right -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -d robot_descriptions/​arcosbot/​kinematics/​sahand/​ 
 +  sahand_yarp_sim -b /​arcosbot-real -r -d -n -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py -s 
 +  torque_sim -b /​arcosbot-real -r -a robot_descriptions/​arcosbot/​kinematics/​lwr/​ -c robot_descriptions/​arcosbot/​kinematics/​sahand/​calibration_data/​finger_calibration_data.py -f robot_descriptions/​arcosbot/​kinematics/​sahand/​hands_kin.py -s 
 +  run_right.sh "/​arcosbot-real"​ 
 +   
 +==== Sending commands to the Arcosbot server ==== 
 + 
 +If the arcosbot server is running the system for using the robot, then it is possible to just send commands to the server using YARP.  
 + 
 +  * Make sure that you are in the same physical network as the humanoid robot 
 +  * Detect arcosbot'​s yarp server 
 + 
 +  yarp detect --write 
 +   
 +Now YARP will use the remote server. You can send basic commands to the robot using kbd commands.
  
 +  run_right.sh "/​arcosbot-real"​
 ===== Common Problems ===== ===== Common Problems =====
  
Line 559: Line 769:
  
  
 +===== Changing robot base position/​orientation =====
 +
 +==== Changes in KRC ====
 +
 +
 +  * Physically relocate the robot in the new designated place.
 +  * Annotate or find out the new orientation information. (Translation/​Rotation in X, Y and Z) (remember to annotate the order of this rotations)
 +  * Gravitation vector points away from the earth
 +  * Check, with cartesian jogging, the direction of the robot base axis. This will help to correctly project the gravitation vector onto those axis.
 +  * Update the gravitation vector in file 
 +
 +<​file>​c:​\krc\roboter\krc\steu\mada\$custom.dat</​file>​
 +
 +  * Restart and check \$torque_tcp_est variable. No value should be bigger than 3 Newtons
 +  * Consider changing the hand mounting orientation.
 +  * If hand mounting orientation changed, update hand mass data:
 +   * In the KRC, change to administrator privileges.
 +   * Setup->​Tool->​Payload data->​Tool no: 2 (hand tool), Continue
 +   * Adjust corresponding values (mass, x, y, z)
 +   * Restart and check \$torque_tcp_est variable. No value should be bigger than 3 Newtons
 +  * Move the robot in joint space to an appropriate initial pose. (away from table, away from joint limits, easy for table reaching)
 +  * Open \R1\Program\FRIDemo\FRIControl.src file.
 +  * With the cursor move to line before "PTP P6" line
 +  * Select: Commands->​Motion->​PTP
 +  * Select the correct base and hand tool frames.
 +  * This will add the new ARM starting position.
 +  * Erase the previous "PTP P6" ​ line: Put cursor on this line, then: Program->​Delete
 +  * Restart KRC
 +  * 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:
 +
 +<​file>​robot_descriptions/​arcosbot/​kinematics/​lwr/​config-lwr-right.py</​file>​
  
 +  * Adjust initial_joint_pos (use the ones from the fri KRC initial joint positions)
 +  * 
  
  • tutorials/object_manipulation_robot_simulator.txt
  • Last modified: 2019/11/15 09:27
  • by admin