{"action":"created","issue":{"url":"https://api.github.com/repos/robotology/QA/issues/98","repository_url":"https://api.github.com/repos/robotology/QA","labels_url":"https://api.github.com/repos/robotology/QA/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/robotology/QA/issues/98/comments","events_url":"https://api.github.com/repos/robotology/QA/issues/98/events","html_url":"https://github.com/robotology/QA/issues/98","id":133012548,"number":98,"title":"Sampling eye-head coordination in the iCub search space","user":{"login":"ashrafzia","id":13050644,"avatar_url":"https://avatars.githubusercontent.com/u/13050644?v=3","gravatar_id":"","url":"https://api.github.com/users/ashrafzia","html_url":"https://github.com/ashrafzia","followers_url":"https://api.github.com/users/ashrafzia/followers","following_url":"https://api.github.com/users/ashrafzia/following{/other_user}","gists_url":"https://api.github.com/users/ashrafzia/gists{/gist_id}","starred_url":"https://api.github.com/users/ashrafzia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashrafzia/subscriptions","organizations_url":"https://api.github.com/users/ashrafzia/orgs","repos_url":"https://api.github.com/users/ashrafzia/repos","events_url":"https://api.github.com/users/ashrafzia/events{/privacy}","received_events_url":"https://api.github.com/users/ashrafzia/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/robotology/QA/labels/simulator","name":"simulator","color":"009800"},{"url":"https://api.github.com/repos/robotology/QA/labels/software","name":"software","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-11T15:57:24Z","updated_at":"2016-02-12T10:04:14Z","closed_at":null,"body":"Hi Guys,\r\n\r\nAm new to iCub. Please ignore any silly mistakes.\r\n\r\nAm trying to **sample joint values** of **eye-hand coordination** in the iCub simulator.\r\n\r\nPreviously, i defined a position in the iCubs search space using the cartesian coordinate system, reach their using the right arm and when given the same x,y and z coordinates to the fixation point i can look at it and the head adjusts automatically.\r\n\r\nNow, i want to **record** all values i.e joint angles of the right arm + wrist (**7 values**), pan, tilt and vergence of the eyes (**3 values**) plus pitch,roll and yaw of neck (**3 values**) when given a position (x,y,z coordinates) in the search space which is iteratively updated, so **3 values** for the coordinates.\r\n**Total ( 7 + 6 + 3 = 16 )**\r\n\r\n\r\n\r\nI have the following script to run my program:\r\n\r\n```\r\n#!/bin/sh\r\ngnome-terminal --profile=\"Default\" --tab -t \"YarpServer\" -e \"bash -c \\\"yarp conf --clean; && yarp server; exec bash\\\"\" \\\r\n--tab -t \"iCubSimulator\" -e \"bash -c \\\"sleep 2 && iCub_SIM; exec bash\\\"\" \\\r\n--tab -t \"simCartesianController\" -e \" bash -c \\\"sleep 3 && simCartesianControl; exec bash\\\"\" \\\r\n--tab -t \"right_arm Controller\" -e \"bash -c \\\"sleep 4 && iKinCartesianSolver --context simCartesianControl --part right_arm; exec bash\\\"\" \\\r\n--tab -t \"iKinGazeCtrl\" -e \"bash -c \\\"sleep 2 && iKinGazeCtrl --from configSim.ini; exec bash\\\"\" \\\r\n--tab\r\n```\r\nI can see the arm configuration when i move to a particular location, in a terminal which i have associated with the right_arm as:\r\n\r\n```\r\nTarget rxPose   [m] = -0.400000\t-0.400000\t 0.800000\t-0.350747\t-0.897678\t-0.266741\t 1.314759\r\n  Target txPose   [m] = -0.220152\t-0.006505\t 0.342514\t 0.463208\t-0.884254\t 0.059442\t 1.978500\r\nTarget txJoints [deg] = -95.000000\t 23.780724\t 61.731054\t 82.149945\t 40.205303\t-11.674962\t 6.022538\r\n  norm(rxPose-txPose) = pos [m]: 0.629664\r\n                        ang [*]: 1.09984\r\n    computed in   [s] = 0.042202\r\n\r\n```\r\n\r\n**Question 1:** How can i access or store the above joint angles? that are opened in a separate terminal.\r\n\r\n**Question 2:** What if i define a starting point and a final point in the search space for the arm to move around and that should be followed by the head (eyes+neck)?\r\n\r\n**Question 3:** If the given points are unreachable then what value will be stored?\r\n\r\nI have been using the following functions previously:\r\ngetPose() -> getting initial configuration of arm\r\ngotoPoseSync() -> moving to a particular location in space along with the acknowledgement.\r\ngetFixationPoint() and lookAtFixationPoint() -> for the eyes.\r\n\r\nAny guideline or comments if i am going in the right direction?\r\n\r\nThank you\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/robotology/QA/issues/comments/183258967","html_url":"https://github.com/robotology/QA/issues/98#issuecomment-183258967","issue_url":"https://api.github.com/repos/robotology/QA/issues/98","id":183258967,"user":{"login":"pattacini","id":3738070,"avatar_url":"https://avatars.githubusercontent.com/u/3738070?v=3","gravatar_id":"","url":"https://api.github.com/users/pattacini","html_url":"https://github.com/pattacini","followers_url":"https://api.github.com/users/pattacini/followers","following_url":"https://api.github.com/users/pattacini/following{/other_user}","gists_url":"https://api.github.com/users/pattacini/gists{/gist_id}","starred_url":"https://api.github.com/users/pattacini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattacini/subscriptions","organizations_url":"https://api.github.com/users/pattacini/orgs","repos_url":"https://api.github.com/users/pattacini/repos","events_url":"https://api.github.com/users/pattacini/events{/privacy}","received_events_url":"https://api.github.com/users/pattacini/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T10:04:14Z","updated_at":"2016-02-12T10:04:14Z","body":"Hi @ashrafzia \r\n\r\nLet me suggest you to use [**`yarpmanager`**](http://www.yarp.it/yarpmanager.html) to launch modules: it's much more handy than relying on dedicated scripts.\r\n\r\n##### Answer 1\r\n- You can access robot joints (e.g. neck, eyes, arm ...) through the `yarp::dev::IEncoders` motor interface. See this [**tutorial**](http://wiki.icub.org/iCub/main/dox/html/icub_motor_control_tutorial.html) to find out more.\r\n-  You can easily log and store joints values as they change throughout your experiments relying on [**`yarpdatadumper`**](http://www.yarp.it/group__yarpdatadumper.html).\r\n\r\n##### Answer 2\r\nPerhaps I didn't catch your exact point, but the Cartesian space (what you call the \"_search space_\") is common to both the Cartesian controller of the arm and the Gaze controller; therefore, you can provide them with the same targets and, as result, the head and the eyes will somehow follow the arm movements.\r\n\r\n##### Answer 3\r\nArm and Gaze controllers do employ nonlinear optimization underneath that intrinsically deals with unfeasible goals. Thus, if you ask to attain out-of-reach targets, the optimizer will instruct the controller to move to the closest point still reachable."}}