ADVRHumanoids / gap_crossing

Master Thesis on "Planning techniques for the Gap Crossing Task" in collaboration with Francesco Roscia e Matteo Sodano, from La Sapienza
2 stars 0 forks source link

Replay Trajectory Inverse Kinematic #10

Closed EnricoMingo closed 4 years ago

EnricoMingo commented 4 years ago

You'll be using our software for robot control, more specifically the CartesIO library. You can find the documentation by following this link. Give a look around and begin from the quickstart section, which contains a tutorial. You can find binary packages below. Follow the instructions included in the README.md file.

xenial-2020_06_08_19_57_34.tar.gz

FYI @alaurenzi

matteosodano commented 4 years ago

We have downloaded the file and followed the instructions in the README. We have also completed the tutorial in https://advrhumanoids.github.io/CartesianInterface/quickstart.html.

alaurenzi commented 4 years ago

The code from

A. Laurenzi, E. M. Hoffman, M. P. Polverini and N. G. Tsagarakis, 
"An Augmented Kinematic Model for the Cartesian Control of the Hybrid Wheeled-Legged Quadrupedal Robot CENTAURO," 
in IEEE Robotics and Automation Letters, vol. 5, no. 2, pp. 508-515, April 2020.

is available in this repo. Follow the instructions inside README.md, but remember to checkout the branch refactor2020

Paper: ICRA19WheeledLocomotion.pdf

matteosodano commented 4 years ago

We have downloaded and extracted the linked repo into the src folder of our catkin workspace, but we have some problem in compiling. In particular, we have the following error when executing catkin_make:

Screenshot from 2020-06-13 15-48-27

Do you have any suggestion?

alaurenzi commented 4 years ago

Yes, I provided you some binaries of my latest development version which has a small incompatibility with centauro_cartesio's cmake code. Please check out the branch devel-cpack, which fixes the incompatibility.

Furthermore, an example jupyter notebook is also present in the repository under the python subfolder.

francesco-roscia commented 4 years ago

We have downloaded and compiled the files from devel-cpack but when we execute mon launch centauro_cartesio centauro_car_model.launch (or any other launch file in the folder), we get the following error: environment variable 'ROBOTOLOGY_ROOT' is not set Moreover, we have seen that in the launch file there is (from line 12 on)

<param name="robot_description" 
    textfile="$(env ROBOTOLOGY_ROOT)/configs/CentauroConfig/urdf/centauro.urdf"/>
<param name="robot_description_semantic"
     textfile="$(env ROBOTOLOGY_ROOT)/configs/CentauroConfig/srdf/centauro.srdf"/>

and we do not have any file named centauro.urdf and centauro.srdf.

EnricoMingo commented 4 years ago

Hi @francesco-roscia, first you need to download a package dependency given by another robot, COMAN+ because the upper body of the two robots are the same (basically centauro point to some files in this other repo): COGIMON MODEL REPO

You have to add this repo to your ROS_PACKAGE_PATH (or download it into your catkin_ws). Then you should be able to use the following centauro.urdf and centauro.srdf:

centauro_urdf_srdf.zip

matteosodano commented 4 years ago

Hi. We have a little problem with a ROS listener in Python. We want to get the coordinates of the com wrt the world frame. When we execute the following lines

rospy.init_node('simple_commands')
listener = tf.TransformListener()
(t,r) = listener.lookupTransform('ci/com', 'ci/world', rospy.Time(0))

from the terminal, everything works fine. When we use the same lines from a Python script, we get the following error:

Traceback (most recent call last):
  File "/home/matteo/catkin_ws/src/centauro_cartesio-devel-cpack/python/simple_commands.py", line 15, in <module>
    (t,r) = listener.lookupTransform('ci/com', 'ci/world', rospy.Time(0))
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/listener.py", line 104, in lookupTransform
    msg = self._buffer.lookup_transform(strip_leading_slash(target_frame), strip_leading_slash(source_frame), time)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/buffer.py", line 87, in lookup_transform
    return self.lookup_transform_core(target_frame, source_frame, time)
tf2.LookupException: "ci/com" passed to lookupTransform argument target_frame does not exist.

This error remains with every FIRST argument of the lookupTransform function, except when using ci/world. Do you have any suggestion?

EnricoMingo commented 4 years ago

Did you try /ci/com ?

matteosodano commented 4 years ago

@EnricoMingo we have solved by catching the LookupException and putting everything into a while loop. It appears that it needed some iterations before setting up the communication, and that was the origin of our problem.

francesco-roscia commented 4 years ago

Dear all, we have worked out an example of a sequence of primitives for Centauro in cartesio. The primitives are: roll with four wheels, spin around the car frame origin on the ground plane, step with each foot and translation of the CoM without varying the stance. During the swing phase of the step, we check if the projection of the CoM is inside the support polygon with frequency 10 Hz. We attach a video as a demo (the lag is due to the recorder).

Video_01.mp4.zip

EnricoMingo commented 4 years ago

Very nice!!! Perfect, we now can transform the output of the planners in joint space commands for the robot. With @alaurenzi we are going to provide you the debians of the dynamic simulations to try to run these trajectories in simulations to check if are stable. In the mean time you can try to connect run the pipelie: planner + IKm ok?

matteosodano commented 4 years ago

Hi. We have developed a connection between the OMPL output and cartesio, but we have encountered a problem. We have considered tasks like rolling and spinning as tasks for the car frame. In doing so, we can't be sure that the wheels arrive exactly where the planner has decided, due to the IK. We have tried to disable some tasks, but we haven't been able to completely block the legs, so that the robot is just a rigid body that can translate or spin. Do you have any suggestion to solve this problem?

EnricoMingo commented 4 years ago

Hi, You can control each individual leg to reach the desired pose once you reach the desired position of the floating base. The leg will move with the wheels spinning accordingly and keeping the pose of the floating base. Maybe @alaurenzi can give us more suggestions on this?

Inviato da iPhone

Il giorno 18 lug 2020, alle ore 15:52, matteosodano notifications@github.com ha scritto:

 Hi. We have developed a connection between the OMPL output and cartesio, but we have encountered a problem. We have considered tasks like rolling and spinning as tasks for the car frame. In doing so, we can't be sure that the wheels arrive exactly where the planner has decided, due to the IK. We have tried to disable some tasks, but we haven't been able to completely block the legs, so that the robot is just a rigid body that can translate or spin. Do you have any suggestion to solve this problem?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

matteosodano commented 4 years ago

We thought about that, but this may arise other problems. For example, if the robot is close to the gap the kinematic inversion may put one (or more) wheel inside the gap, while the planner was commanding to do something else.

EnricoMingo commented 4 years ago

Did you try to command as well the trajectory for the feet together with the base? The Ik should try to fulfill both, I would give it a try

Inviato da iPhone

Il giorno 18 lug 2020, alle ore 16:37, matteosodano notifications@github.com ha scritto:

 We thought about that, but this may arise other problems. For example, if the robot is close to the gap the kinematic inversion may put one (or more) wheel inside the gap, while the planner was commanding to do something else.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

alaurenzi commented 4 years ago

My usual stack has wheel positions as first priority together with the virtual frame. Since there are enough dof, I expect both tasks to be accomplished with zero error at all times. If this is not true, please report the stack you're using, plus some plots to show the issue.

matteosodano commented 4 years ago

Hi everyone. We managed to solve the problem following your suggestions. Now cartesio brings centauro exactly where OMPL planned. Thank you all.