Pinocchio: Error about collision checking in practical-exercises?

Created on 28 Feb 2019  路  14Comments  路  Source: stack-of-tasks/pinocchio

Hi, there
I recently do the practical-exercises as your tutorial says 4.3) Collision checking
But when I run in python, I meet an error:

File "example_q4_contact.py", line 22, in <module>
    dist = robot.checkCollision(idx)                          
  File "/home/xxx/pinocchio/doc/d-practical-exercises/src/robot_hand.py", line 295, in checkCollision
    dist = va.collision(vb, self.data)                          
  File "/home/xxx/pinocchio/doc/d-practical-exercises/src/robot_hand.py", line 61, in collision
    if all(0 <= ab <= 1):
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

As the tutorial says: Pinocchio also implement a complete and efficient collision checking based on FCL, also not used in the tutorial, which means this way of collision checking is used temporary just for exercise. If I'm right, then where could I find the tutorial that Pinocchio implement based on FCL, not just exercise?
Wish you have a nice day!

bug

All 14 comments

Will fix it. Thanks for this report.

What do you mean by tutorial?

The way used for collision checking in robot_hand.py is not the FCL way. Maybe use FCL in robot_hand.py will better as a tutorial.
We should use native API as much as possible, rather than "make" a new one.

You're right. We wanted to mask a lot of FCL API to allow end users.
But it remains possible to use the classic API of FCL.

Maybe, it would be nice for someone to do it. @littleggghost Do you think you may write such an example? Thanks in advance for your contribution to Pinocchio.

Well, I will do that if I have the time. As a beginner, there is still a long way to go.

If you already know FCL, it just a matter of seeing how the functions for collision detection are working. All these details are located here: here for updating the placement of the collision meshes and here for calling FCL funtions.

And of course, we can help you.

I will try the python-bindings of the two functions you mentioned.

I started to change this tutorial to go to FCL detection collision. I then stopped because of some data resulting of FCL algorithms not properly bound to python-pinocchio. Related to #638

Hi, @nmansard
What do you think of my collision test as I mentioned as follows?

I want to make a collision test:
A box falls freely to the ground, causing bouncing and rolling till stop, and we can check it on gepetto-viewer.
Should I start a new issue @jcarpent
And any advices?

Hi, @jmirabel
I noticed you are familiar with FCL. Could you check this exercise?

We have in mind to make hpp-fcl more robust (and unit-tested) but there is no timeline yet. I have no time to allocate to this. I could provide some guideline if anyone is willing to handle this.

@littleggghost To make the story short, when starting hpp-fcl the team did not want to redo another collision library. But all the PR to fcl were ignored forcing us to do a fork. When the fcl library was reboot, it was mostly to work on the CPP interface not on correcting the algorithms. @florent-lamiraux could give a more accurate account on this.

This issue has been fixed by #725.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmastalli picture cmastalli  路  7Comments

cmastalli picture cmastalli  路  12Comments

markusgft picture markusgft  路  12Comments

CWEzio picture CWEzio  路  9Comments

nim65s picture nim65s  路  8Comments