线程Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Collision Avoidance

#21
(04-30-2019 07:39点)Albert Wrote: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

Hi Albert, thanks for this usefull tip

But I do not find any documentation on SaveSamples and SaveMap on the API doc , is there an other link for a updated documentation ?

Thank in advance,

Have a good day
#22
Unfortunately we don't have documentation about this special API feature. The sample code I sent you works and creates a CSV file.
#23
(03-22-2019, 02:20 PM)Albert Wrote: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


Hey Albert,

I am trying to run this command in my python script:

Code:
mbox('before')
status = RDK.PluginCommand("CollisionFreePlanner", "Join", "Target 1|Target 2|Path")
mbox('after')


I can see `before` message, then it simulates the motion from Target 1 to Target 2. But I never see `after` message. Am I loosing control flow somehow?

Thanks in advance,
Yury
#24
It may take some time to joint these 2 targets. Do you see any other messages?

If you can provide your RoboDK project file we can better take a look.
#25
Sure, here it is. The code is in the FindPath python file.

TIA,
Yury


Attached Files
.rdk b-sample.rdk(Size: 1.94 MB / Downloads: 146)
#26
(07-19-2022, 12:25 PM)yurykotlyarov写道:Sure, here it is. The code is in the FindPath python file.

TIA,
Yury

Everything works just fine if I drop 'Base' item under the robot




Users browsing this thread:
1 Guest(s)