- Posts: 2419
- Thank you received: 0
ROS LinuxCNC Link
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.
Please Log in to join the conversation.
- thefabricator03
- Topic Author
- New Member
-
- Thank you received: 0
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 to join the conversation.
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
Please Log in to join the conversation.
- thefabricator03
- Topic Author
- New Member
-
- Thank you received: 0
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 to join the conversation.
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 to join the conversation.
- thefabricator03
- Topic Author
- New Member
-
- Thank you received: 0
Please Log in to join the conversation.
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.
Please Log in to join the conversation.
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.
Please Log in to join the conversation.
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 to join the conversation.
developers.google.com/edu/python
Video of lesson 1
Please Log in to join the conversation.
