NEWS
LinuxCNC 2.5.2 Release
There are no translations available.

LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release
There are no translations available.

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
There are no translations available.

New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 
Home Forum Configuring LinuxCNC Advanced Configuration OpenCV vision with EMC/linuxcnc

Welcome, Guest
Username: Password: Remember me

TOPIC: OpenCV vision with EMC/linuxcnc

Re:OpenCV vision with EMC/linuxcnc 26 Mag 2012 08:56 #20425

  • ArcEye
  • ArcEye's Avatar
  • NOW ONLINE
  • Moderator
  • Posts: 1336
  • Thank you received: 102
  • Karma: 129
Hi
I don't know what userspace routines do to hand time back to the system, though I guess that is the usleep.
However the realtime tasks will get run regardless.
As Andy said, the usleep will give the CPU to other processes , so CPU time isn't wasted.

With the real-time scheduling kernel, a user-space program is not going to slow the system, the scheduler will always give priority to the real-time processes at the expense of user-space.

There is likely to be a quite finite amount your code can do at each poll, the example fetched 18 items of data and populated the 18 keys in the database.
So yes, if you want to complete each poll, it needs to be quite tight.

The alternative is the 'state' approach used a lot in real-time components, where each poll executes a stage and sets a flag as to which state it is at, for the next poll to pick up from.
This way you can achieve quite drawn out procedures (waiting for a signal etc) efficiently.

You can see the pure C code that comp saves you the trouble of writing, by running comp redisclient.comp.
I haven't found any need to write a module from scratch in C yet. comp is much more convenient and productive.
Andy, please could you try to clarify the problems I might run into making gladeVCP controls for this if I code the hal module in C++?
Purely speculation, really, as all the code embedded in the GladeVCP widgets is Python.
It's a big bug bear of mine that everything is so heavily reliant upon python.

However it does not really matter how the pins and params are created, they will be able to be interfaced with gladeVCP or pyVCP.
So long as you don't mind making the UI in a python based system, your modules will work with it, whatever language they were written in.


regards
Last Edit: 26 Mag 2012 09:17 by ArcEye.
The administrator has disabled public write access.

Re:OpenCV vision with EMC/linuxcnc 26 Mag 2012 23:59 #20440

  • edsimmons
  • edsimmons's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Karma: 0
Thanks for the clarification - I'm pretty sure all this is possible with the right approach.

FPGA/CPLD state machine territory seems most apt for 'thought reuse.'
Am I missing the point here, if I write a loop that does nothing but check the state of pins as fast as possible then sleep (most of the time, especially during motion) and on certain conditions carries out an action, I'm not particularly worried about the time it takes to complete the action since the motion will be waiting for the outcome of the vision module. Or will a delay here screw things up?

I'm glad that the UI is possible, shame it's all python ;)

Thanks for all the input :)

Ed
The administrator has disabled public write access.

Re:OpenCV vision with EMC/linuxcnc 27 Mag 2012 03:55 #20443

  • ArcEye
  • ArcEye's Avatar
  • NOW ONLINE
  • Moderator
  • Posts: 1336
  • Thank you received: 102
  • Karma: 129
Hi
Am I missing the point here, if I write a loop that does nothing but check the state of pins as fast as possible then sleep (most of the time, especially during motion) and on certain conditions carries out an action, I'm not particularly worried about the time it takes to complete the action since the motion will be waiting for the outcome of the vision module. Or will a delay here screw things up?
I am not familiar with the specifics of what you are trying to achieve.

User-space components are slower and not suited for interaction with other real-time processes, if a fast turn round is required, but they do allow an interface with the 'real world' using all the normal libraries etc., which is their big advantage.

All components can all be linked via the pins they expose, this is the strength of the hal system.
You can fetch data from user space and make it available to real-time modules by linking via pins.

Conversely the redis-client module links to real-time modules to fetch data, then passes the data to a database server, through which a normal user-space GUI program can access data values from within the running LinuxCNC system.

regards
The administrator has disabled public write access.

Re:OpenCV vision with EMC/linuxcnc 27 Mag 2012 04:57 #20446

  • cncbasher
  • cncbasher's Avatar
  • OFFLINE
  • Moderator
  • Posts: 686
  • Thank you received: 30
  • Karma: 53
this is one i'm looking at Ed , although it's all java
code.google.com/p/openpnp/
The administrator has disabled public write access.

Re:OpenCV vision with EMC/linuxcnc 27 Mag 2012 09:11 #20448

  • cncbasher
  • cncbasher's Avatar
  • OFFLINE
  • Moderator
  • Posts: 686
  • Thank you received: 30
  • Karma: 53
my thoughts are to implement a sift algorithym to compare smd shape profiles from a database ( this way it's easier to add a footprint from a pcb package)
and use the vision to orient the part to the pcb , hardware is not too difficult , and my thoughts are to use solinoids for the part reels set so one action moves the tape one part , more of a fixed rotation cam , the lifter is just the standard vacuum type on a small servo motor .

i'm looking at using the standard cam file type inputs from eagle ...
The administrator has disabled public write access.

Re:OpenCV vision with EMC/linuxcnc 13 Giu 2012 05:09 #20872

Hi! What a great thread. I am working toward a very similar goal:

http://edinburghhacklab.com/2012/05/optical-localization-to-0-1mm-no-problemo/

While I am doing optics for a robot arm, I am thinking I should upgrade my CNC while I am at it and stumbled across this thread. I was about to intergrate the robot operating system ros.org with linuxCNC. (ROS is maintained by Willow Garage who also maintain OpenCV). Anyway, I would be happy to collaborate getting this working. I don't expect it to take too long (4 weeks?) as I have the vision stuff built already. I just need the ROS to linuxCNC bridge built which is pretty trivial if done in python (ROS works with python and C++, we can switch later if we want).

Tom
The administrator has disabled public write access.
Time to create page: 1.065 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.