Git Product home page Git Product logo

Comments (6)

karthikm-0 avatar karthikm-0 commented on September 23, 2024 1

Thanks a lot for the super detailed response! I'll definitely need to use ROS since I use motion planners and other useful libraries, but I think compiling KDL for Unity would make everything much more responsive.

from franka_ros_interface.

justagist avatar justagist commented on September 23, 2024

Thanks for your kind words!
The packages are currently written expecting realtime robot state data from either the real robot or the simulation (in the form of ROS topics/services).
The panda_simulator package uses gazebo for all the physics computations and simulations for the robot. So it will not be possible to completely remove the dependency on gazebo, as it provides the physics engine required. You can however turn off the rendering to remove the graphics overhead by adding an argument: roslaunch panda_gazebo panda_world.launch gui:=false. This will disable the GUI but still simulate the robot without visualising.
Another option would be to write another robot simulator in Unity which uses Unity's physics to perform the simulation and publish the robot state information in the same topics/services as panda_simulator. This should allow you to use the same interface packages (hopefully without too many issues!), and completely be independent of gazebo.

from franka_ros_interface.

karthikm-0 avatar karthikm-0 commented on September 23, 2024

Thank you for the advice! I ended up creating a service to request IK solutions from the Panda arm interface from my Unity sim. However, I think I may need to go the publisher/subscriber route since it may be too intensive. Do you have any thoughts on that?

from franka_ros_interface.

justagist avatar justagist commented on September 23, 2024

I am not sure I understand what you mean by the publisher/subscriber route?

from franka_ros_interface.

karthikm-0 avatar karthikm-0 commented on September 23, 2024

Sorry, I meant that there are two approaches one could take to update the robot's state using joystick input. In the first, the input is sent from Unity via a service request and the solution is returned which updates the joint states (which is what I am currently doing).

The other approach involves publishing the user inputs and joint states to a topic and having a subscriber that takes these and constantly generates new joint angles in ROS, which the Unity robot can subscribe to and update based on.

Would the service approach be inefficient or too slow for such an application? In that case the pub-sub route makes a lot more sense. I suppose this is more of a general ROS question, but it pertains to IK solutions.

from franka_ros_interface.

justagist avatar justagist commented on September 23, 2024

From your mentions about IK, I assume you want to control the end-effector of the robot in Unity using joystick input? In this case, why not use the IK solver that is already available in Unity? Why do you want to use an external solver such as the one being used by the PandaRobot package? Is it necessary for you to use ROS? You should be able to provide target poses for the end-effector in Unity, and the Unity IK solver should compute the required joint positions for the robot. This is going to be the most efficient in terms of speed and responsiveness, and possibly even in terms of finding optimal solutions.

Both the 'service approach' and the 'pub-sub' approach you mentioned have their issues if efficiency is your priority. Service requests are usually blocking, so the client code may stop till a solution is obtained from the server, which could cause delays. ROS topics route, on the other hand are more prone to loss in data, so quick motions of the robot might be troublesome.
Furthermore, the IK solvers are not always the best way to control the robot's end-effector, especially over motions of longer distance. The solutions saturate, and sometimes even diverge depending on the use case. It can also be seen that the robot's motion drift over time as well depending on the allowed tolerance for the solver. The alternative and more accurate solution is to write a higher-level task space controller for the robot. However, even though this solution is much better in terms of accuracy and tracking, this may be overcomplicating the issue if the motion you have is simple (point to point motions with small distance between each).

In my opinion, if you don't really have to use ROS, I would suggest using the native IK solver in Unity which is quicker and in all possibility, much more efficient. If you still want to use an external library for IK, the solver I use (PyKDL) is based on a C++ library (KDL) which you can probably compile as a plug-in for Unity.

from franka_ros_interface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.