Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collision Avoidance
#11
Hi Jeremy

I am overwhelmed by your quick response to my questions. Currently I am working on a school project that will go on till September. Right now, I am not quite sure yet if I should look into ROS/MoveIt and try to model our robot myself or if the mentioned features above are somewhat feasible in the near future. If so it might even be possible to test that new feature with a prototype that we build in our school. That way I could give a Feedback to the new Features and maybe even help (despite being a beginner in robotics) to improve this feature. The main issue that I see for now is the limited access to the .dll Library and its available functions. That being said the PRM Algorithm in RoboDK seems to work fine and I fear the challenging use of ROS.     
If there is a possibility to receive a newsletter to this topic that would of course be fantastic. I am looking forward to hearing back from you in April otherwise you were already immensely helpful by answering my questions. 

Cheers
Robin
#12
Hi Robin, 

Thank you for your feedback. We'll open a command so you can trigger a PRM update through Python. It will take 2 weeks or so.

For now, you can connect 2 targets or 2 programs through the API. For example, if you want to connect Target1 and Target2 creating a program called SafeMove you can do:

Code:
status = RDK.PluginCommand("CollisionFreePlanner", "Join", "Target1|Target2|SafeMove")

I was unable to reproduce the AddFile issue. You should make sure RoboDK is not busy updating the PRM map or connecting 2 targets, otherwise you may see a timeout issue.

What other commands would you need?
We are currently preparing more material to support this feature.

Albert
#13
Hi Albert
I thought about the PRM Algorithm and came up with some ideas concerning the CollisionFreePlanner Plugin.  
Commands:
-       The already mentioned: Update calculation command
-       Set number of samples (verteces), set edges per sample (neighborhood size), set robot step...all to reduce calculation time in Python
-       RDK.PluginCommand: Return Path-Targets as list to directly use them to assemble a bigger pathà the created programs are maybe only used once, then they have to be deleted (lot size 1 path)  
-       Making sure RoboDK is not updating the PRM Signal (safe to import CAD-Files)
-       setTimeoutTime (if no solution can be found in a useful time frame)… (closed Algorithm needs a big sampling size of Space C)
Maybe some of the mentioned commands are not necessary anymore, when others are implemented.
I attached a file. In the “Tisch_Test” python script I tried to experiment with the simulation speed and the collisionactive Signal. I experienced that the collisions might not be detected when increasing the simulation speed. Maybe I did something wrong. Otherwise I am not quite sure what I can achieve by increasing the simulation speed? Furthermore, I cannot run my test program with the RoboDK-Allow-CollisionFreePlanner.bat, when I delete the Kollisionsgeometrie1&2. This is what I meant with the AddFile issue. If there is any way for me to contribute to this Plugin, then I would be happy to help as I am basically working for free because of my Project assignment.  Hopefully you can reproduce my findings and if you have any questions do not hesitate to contact me.
 
Have a nice day!
Robin


Attached Files
.rdk   RDK_KUKA_KR10R900_250319.rdk (Size: 502.99 KB / Downloads: 214)
.stl   Kollisionsgeometrie.stl (Size: 684 bytes / Downloads: 208)
#14
Hi Robin,

Thank you for your feedback. We have just improved the PRM algorithm with your suggestions. The latest version is available for Download (only Windows 64 bit at this moment). 

Among other things the plugin should be loaded by default. You can select to load/unload it in Tools-Plug-Ins. The timeout issue has also been solved. Let me know if you have any other suggestions or find any issues.

If you speed up your simulation you are less likely to detect collisions. If you want to accurately detect collisions for a robot program I recommend you to right click a program and select Check Path and Collisions (Shift+F5). This may take more time but it will check for collisions given the tolerances set in Tools-Options-Motion.

I attached a new RoboDK project with all the API features that are available:

Code:
# Example plugin commands for the "CollisionFreePlanner" plugin (they are not case sensitive)

# Example to connect 2 robot targets (for example a program that moves from Target 1 to Target 2. The program will be called ProgSample) and create a program called Prog 123
status = RDK.PluginCommand("CollisionFreePlanner", "Join", "Target 1|Target 2|ProgSample")
# Returns "Success" if it was possible to link both targets. Otherwise it returns "Failed"
print(status)

# Example to retrieve the current PRM map information
status = RDK.PluginCommand("CollisionFreePlanner", "Info")
# It returns a string containing the samples and edges in the following format:
# "Samples-edges-Robot name"
print(status)

# Example to add the current robot joints (each joint will be connected to NewNodeEdges samples)
status = RDK.PluginCommand("CollisionFreePlanner", "Add")
print(status)
# This function can be called multiple times in a loop to create your own PRM map given a list of joint values

# Clear data related to the PRM collision free planner
status = RDK.PluginCommand("CollisionFreePlanner", "Clear")
print(status)

# Example to set the number of PRM samples (number of joint configurations):
status = RDK.PluginCommand("CollisionFreePlanner", "Samples", 25)
print(status)

# Example to set the number of PRM edges (connections between joint configurations):
status = RDK.PluginCommand("CollisionFreePlanner", "Edges", 10)
print(status)

# Example to set the number of edges for newly added joint samples
# (connections for new joint configurations added using the Add command or by joining targets/programs):
status = RDK.PluginCommand("CollisionFreePlanner", "NewNodeEdges", 5)
print(status)

# Example to change the path step for collision checking
# (this is a RoboDK command and not a PRM plugin command)
status = RDK.Command("PathStepCollisionDeg", 2)
print(status)

# Example to set the number of edges for newly added nodes
# (connections for new joint configurations added using the Add command or by joining targets/programs):
status = RDK.PluginCommand("CollisionFreePlanner", "Display", 0) #Set to 1 (display) or 0 (hidden)
print(status)

# Example to select a robot for PRM calculations (only useful if you have more than 2 robots in the cell)
robot_name = RDK.PluginCommand("CollisionFreePlanner", "SelectRobot", "Comau")
# It retuns the robot selected
print(robot_name)

# Calculate or update the PRM map (it can take a while)
status = RDK.PluginCommand("CollisionFreePlanner", "Calc")
print(status)

Albert


Attached Files
.rdk   PRM-Automated-Collision-Avoidance.rdk (Size: 1.23 MB / Downloads: 282)
#15
Hi Albert 
 
Thank you so much for your new functions. Currently I am busy building a robot station and testing your functions. As soon as I have used all your new functions I will give a feedback on how they were useful and if there would be anything to change from my perspective. 
 
The function {status = RDK.PluginCommand("CollisionFreePlanner", "Info")} so far only contains the two sizes of the Vertices and Edges. It would be great, if the function could also return the raw data of the Vertices and its Edges. In my project (and a course that I am visiting) I have to look into machine learning. It would be fantastic if I could save the entire cloud of Point with their configuration and write an external function in python that finds an improved path. Maybe there is a possibility to find a relationship between certain paths and collision geometry-xyz that has a higher success rate (no collision) than others. Also, I could implement a path search algorithm. Would it be possible to return these two data lists via the mentioned function?
 
I am looking forward to hearing from you and I will get back to you with my feedback on the new functions as soon as the station layout is complete.  
 
Have a nice day!
Robin
#16
Hi Robin,

Thank you for your feedback. There is a new update that includes the option to save your samples and the edges matrix through the API as CSV files. As an example, you can use the following code:

Code:
current_rdk_file = RDK.getParam("FILE_OPENSTATION")

# Save the N samples as a CSV file: joint values will be saved as one row per set of joints
status_msg = RDK.PluginCommand("CollisionFreePlanner", "SaveSamples", current_rdk_file + "-Joints.csv")
print(status_msg) # Returns "Done" if it worked

# Save the map as a CSV file (matrix of size NxN)
status_msg = RDK.PluginCommand("CollisionFreePlanner", "SaveMap", current_rdk_file + "-Map.csv")
print(status_msg) # Returns "Done" if it worked

Albert
#17
Hi Albert

I can't thank you enough, thats awesome! 

Have a nice evening!
Robin
#18
Hi Albert
 
I tried the new CollisionFreePlanner Commands. There are some issues that currently just don't want to work for me:
When i use status = RDK.PluginCommand("CollisionFreePlanner", "Clear"), the collision Map seems to be deleted, however if I click on the "Display map" button, the old Data including the samples is still stored somewhere and will be displayed. 
When using status = RDK.PluginCommand("CollisionFreePlanner", "Join", "Target 1|Target 2|ProgSample") it often returns "False". Despite playing with the other parameters (PathStep, Edges, Samples) it will never find a solution to connect the two points. But as soon as I click on the "link selected targets/programs button" in RoboDK it finds a valid solution and creates the Program between the two points. 
It is hard for me to comprehend what is going on behind the Python instructions versus the graphical interface of RoboDK. All I can say for sure is that there are some discrepancies between the two options to operate the .dll.
I hope you are able to reproduce my description as I am not able to upload my project to the public. If something is unclear I am happy to help!
Have a nice weekend!
Robin 
#19
Hy again
 
Since the latest update of RoboDK 3.8.4 the issue I described on May 10'th seems to be solved. However, I noticed that the PRM Algorithm creates a valid PRG despite having collisions (in between the samples) in it. After running "status = RDK.PluginCommand("CollisionFreePlanner", "Join", "Target 1|Target 2|ProgSample")" I can easily check if the path has collisions by using the code below. However, the PRM does not offer any alternative Paths after it found a "valid" solution. My suggestion would be to take the code below into the PRM algorithm evaluation so the search for a collision free path can continue if a collision is detected. Otherwise the whole map becomes useless, because the only way to find another path, as far as I can see, is to refresh the collision map.
 
Simulation speed: I already simplified most collision geometries in the station. However the calculation time of the map takes quite a while. Are there any new addons that make better use of the grapics card? My graphics card usage is always below 5 percent (with or without the option “GPU Array usage”). Also my processor seems to be running at 50 % usage without turbo-boosting up.  Any hints are appreciated.
 
If you have any questions to elaborate on one of my descriptions, I will be happy to.
 
Regards, Robin


Code:
# Source: https://robodk.com/doc/en/PythonAPI/robolink.html?highlight=prog#robolink.Robolink.AddProgram  
# Update the path (can take some time if collision checking is active)
   program = RDK.Item('ProgSample')
   update_result = program.Update(COLLISION_ON)
   print(update_result)
#20
Hi Robin,

Can you share the RoboDK project that creates a collision? (RDK file)
What settings are you using?

Collision checking splits paths by steps of 4 deg. You can change this setting to be more accurate but it will take more time. There could also be a collision within this range so I would recommend increasing the size of your objects to make sure no collision is missed.

Collision checking doesn't use graphics card resources.
  




Users browsing this thread:
1 Guest(s)