Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision detection #376

Closed
jianchaoci opened this issue May 31, 2023 · 3 comments
Closed

Collision detection #376

jianchaoci opened this issue May 31, 2023 · 3 comments

Comments

@jianchaoci
Copy link

Hi,

I want to use roboticstoolbox to do collision detection. But I got a problem when creating the obstacles. I follow the instruction you give to crate box using rtb.Box(). But I got an error as below.

image

@jkaniuka
Copy link
Contributor

Hi @jianchaoci 👋, I've attached the working code below

import roboticstoolbox as rtb
from spatialmath import *
from spatialgeometry import *

panda = rtb.models.Panda()
obstacle = Cuboid([1, 1, 1], pose = SE3(1, 0, 0))
iscollision = panda.iscollided(panda.q, obstacle) # boolean
iscollision = panda.links[0].iscollided(obstacle)

@jianchaoci
Copy link
Author

Hi @jianchaoci 👋, I've attached the working code below

import roboticstoolbox as rtb
from spatialmath import *
from spatialgeometry import *

panda = rtb.models.Panda()
obstacle = Cuboid([1, 1, 1], pose = SE3(1, 0, 0))
iscollision = panda.iscollided(panda.q, obstacle) # boolean
iscollision = panda.links[0].iscollided(obstacle)

Hi Jkaniuka,
Really thanks for your reply. I am wondering is there a method to help to visualize the created obstacle. And is there a IK_xx method to help to avoid those solutions collide the obstacle?

@jkaniuka
Copy link
Contributor

@jianchaoci, glad I could help 😉 I've only used robotics-toolbox-python to generate manipulator trajectories, so I don't know if it has the functions you're talking about. I can, however, offer you other solutions 😄

  • Robotics Toolbox for Python uses PyBullet for collision checking. Using this module, you can easily visualize the obstacles you add. Besides, you can check there whether the robot collides with an obstacle. You can find sample code in this tutorial - Collision Detection in PyBullet.
  • If you want to generate a trajectory so that the robot does not come into collision with an obstacle, you can use MoveIt. MoveIt is motion planning framework that is part of ROS 2. If you're familiar with Robot Operating System, I suggest you check this tutorial - Planning Around Objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants