ROS LinuxCNC Link

More
27 Mar 2021 11:39 #203796 by Grotius
Replied by Grotius on topic ROS LinuxCNC Link
Hi,

For info. In python you can do a system command.
For example : "halcmd setp ..." as a system command will work.

This is not very elegant, but it helps you in the process.

If you need any python examples how to set up port's and pin's. I have them somewhere on my hdd.
The following user(s) said Thank You: thefabricator03

Please Log in or Create an account to join the conversation.

More
27 Mar 2021 11:48 #203797 by thefabricator03
Replied by thefabricator03 on topic ROS LinuxCNC Link
Thanks,

If you could post the examples in this thread when you get a spare minute I am sure it will help more that just myself.

Please Log in or Create an account to join the conversation.

More
27 Mar 2021 11:49 #203798 by andypugh
Replied by andypugh on topic ROS LinuxCNC Link

thefabricator03 wrote: I would like to create a Python based programming language for controlling the robots rather than G-Code. Tormach are doing this with their new robot. Would I have to write a new interpreter for this?


A new interpreter would be one way. LinuxCNC supports pluggable interpreters.

An alternative is to send "canonical commands" direct from the Python. (this might be considered an interpreter...)

There is example code that does that here:

github.com/LinuxCNC/linuxcnc/blob/andypu...python/remap.py#L441

However: I haven't figured out how to access the emccanon module outside of a G-code remap (but have never needed to, so have not looked so hard). Generally Python routines send G-code through the MDI interface.

The emccanon source code is probably the best reference to the available commands:
github.com/LinuxCNC/linuxcnc/blob/master...74ngc/canonmodule.cc
There is a sample pluggable interpreter that uses the same commands, try the sample config sim-axis-canterp for an example.
Sending G-code as MDI is covered here: linuxcnc.org/docs/2.8/html/config/python-interface.html
The following user(s) said Thank You: thefabricator03

Please Log in or Create an account to join the conversation.

More
27 Mar 2021 11:58 #203799 by thefabricator03
Replied by thefabricator03 on topic ROS LinuxCNC Link
Does LinuxCNC also support plug able trajectory planners?

ROS is not a black box, rather a framework of libraries. It has trajectory planers purpose built for robots. Could I use the LinuxCNC framework but substitute the default planner for a robot specific one?

Please Log in or Create an account to join the conversation.

More
27 Mar 2021 12:39 #203800 by andypugh
Replied by andypugh on topic ROS LinuxCNC Link

thefabricator03 wrote: Does LinuxCNC also support plug able trajectory planners?

ROS is not a black box, rather a framework of libraries. It has trajectory planers purpose built for robots. Could I use the LinuxCNC framework but substitute the default planner for a robot specific one?


What is the output of the ROS planner? If it was waypoints on a 1mS clock (realtime) then you could connect it to output devices in LinuxCNC HAL.

Please Log in or Create an account to join the conversation.

More
27 Mar 2021 12:42 #203801 by thefabricator03
Replied by thefabricator03 on topic ROS LinuxCNC Link
I am not sure at this point but I will keep that in mind.

Please Log in or Create an account to join the conversation.

More
27 Mar 2021 12:59 - 27 Mar 2021 13:09 #203804 by Grotius
Replied by Grotius on topic ROS LinuxCNC Link
Hi,

If you could post the examples in this thread when you get a spare minute I am sure it will help more that just myself.
I accidentaly whiped one of my usb's last week when i left it in the pc, when doing writing a iso to usb.
Begin next week i can download the python examples from a production machine.

Does LinuxCNC also support plug able trajectory planners?
This is a pain in the ass. :laugh:
If it was so. We could load userspace trayectory planners, wich can do amazing stuff. Then you could do motion profiles
for humanoid robot's etc, Or exotic dmg-mori profiles.

If it was waypoints on a 1mS clock (realtime) then you could connect it to output devices in LinuxCNC HAL.

Most handy is to connect to the stepgen and use the stepgen as pid. Then the waypoints may have a non realtime interval.
The stepgen kernel module does the realtime thing.

The stepgen tuning is important. For robot's there is a mathamatical thing to consider.
When motor 'a' has a acc of 10 and motor 'b' has a acc of '5' with the same reduction, the lineair path isn't correct.
A fix for this is calulate the ratio and sent the 'acc' value for each motor motion to hal.

I am curious if Ros has this important issue build in.
Last edit: 27 Mar 2021 13:09 by Grotius.
The following user(s) said Thank You: thefabricator03

Please Log in or Create an account to join the conversation.

More
27 Mar 2021 16:39 #203812 by Grotius
Replied by Grotius on topic ROS LinuxCNC Link
One thing about Ros. It uses kdl kinematics.
This library has a iteration value that can be set. For example 120.
That is performing 120 calculation's to optimize the inverse kinematics.

This will result that a cyclustime of 1ms is not possible. Therefore the stepgen as pid is
imporant to take away gap's between the iterations.
The following user(s) said Thank You: thefabricator03

Please Log in or Create an account to join the conversation.

More
28 Mar 2021 10:47 #203877 by Grotius
Replied by Grotius on topic ROS LinuxCNC Link
Hi,

I was thinking a little bit more about your Ros project.

Maybe i can help a little bit more.

My proposal is to set up a Ros environment and a Linuxcnc environment in a Linux distribution for Robot's.

In this distro i would like to embed the Ros environment, the Kdl (kinematic library), the Opencascade (CAD) library, wich is also used by Freecad, with a basic and simple coding example, wich i have to create.

Also i would embed a basic matix calcuation example how to multiply matrixes to do a workpiece xyz (roll,pitch,yaw) offset.
This sounds quite complex, but in fact, it's quite easy when you know what to do.

For universaties and students, this distro would be helpfull worldwide.

Do you work with Mesa or something else ?

Do you have already played around with Ros? I have no clue and never used Ros. So for me it's totally new.

The connection from Ros to Linuxcnc Hal should not be a time consuming operation to get this fixed.
I already have c++ code for this. I can not write python.

Please Log in or Create an account to join the conversation.

More
28 Mar 2021 10:56 #203878 by rodw
Replied by rodw on topic ROS LinuxCNC Link
Grotius, I think you should devote 3-5 days learning Python by following the Google Python tutorials. I find I don't use it enough so its hard for me but when I do get it, I can write in 100 lines of Python what would take 1000 lines in C.

developers.google.com/edu/python

Video of lesson 1
The following user(s) said Thank You: thefabricator03

Please Log in or Create an account to join the conversation.

Time to create page: 0.122 seconds
Powered by Kunena Forum