Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get trajectory path length with API or/and via short python script
#1
Hi guys,



I'm back with a general theoretical question.

Is it possible to directly determine the length of the trajectory (or path) of a moving TCP using the RoboDK API with a short Python script?

The background is that I want to know if the trajectory from point A to point B is shorter than the path from point A to point C (e.g. length in millimetres [mm]). Is it possible to get an output of the traveled path length with the API or using a short python script?


Greetings from Germany


奥立
#2
Hello,

With the API, calling the prog_item.Update() will return an estimate of the distance travelled, in mm.
See//www.sinclairbody.com/doc/en/PythonAPI/robo...tem.Update
Please read the论坛Guidelinesbefore posting!
Find useful information about RoboDK by visiting our2022世界杯32强赛程表时间 .
#3
(05-30-2022, 10:36 AM)Sam Wrote:Hello,

With the API, calling the prog_item.Update() will return an estimate of the distance travelled, in mm.
See//www.sinclairbody.com/doc/en/PythonAPI/robo...tem.Update

Thank you very much for your answer Sam, it helped me a lot. I used this code block with your help.




...

[n_instructions, program_time, program_distance, valid_ratio, readable_msg] = prog.Update()
print("Distance in [mm]: ",program_distance)
print("Time in [s]: ",program_time)
...

Works perfectly for me. Thank you!
#4
You're definitely familiar with the best coding language C++ that developers use to develop their projects and they get all their queries like "expected unqualified-id before 'if'" answered properly. Developers are finding an appropriate answer about expected unqualified-id before 'if' related to the C++ coding language.
https://codeprozone.com/code/cpp/33583/e...re-if.html




Users browsing this thread:
1 Guest(s)