- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
How would you design a real time application for cnc control in c / c++ ???
- tommylight
- Away
- Moderator
- Posts: 19188
- Thank you received: 6432
Please Log in or Create an account to join the conversation.
Attachments:
Please Log in or Create an account to join the conversation.
This can be solved by checking the .pro file, this section points to hal, check your current hal includepath on your local pc :
#lcnc
INCLUDEPATH += /usr/lib/ \
/usr/lib/linuxcnc/modules/ \
/usr/include/ \
/usr/include/linuxcnc/
LIBS += -llinuxcnchal -lethercat -Iinclude -Isrc/emc/rs274ngc -Llib -lnml -llinuxcnc -llinuxcnchal -llinuxcncini -lposemath
@Tommy,
Kunena is embedding (not hosting) youtube video type's, but mp4's most be enabled by forum admin i suppose.
Microsoft, google, youtube, facebook, are all not my favo's. Maybe i can better host myself.
Please Log in or Create an account to join the conversation.
I wonder if maybe I should just reinstall Linuxcnc through the package manager. Although I have been advised to remove that when using a RIP install.
Attachments:
Please Log in or Create an account to join the conversation.
Ahh, i already thought about something like that.
Keep your Lcnc rip where it was compiled. Just link to the libs pointed out it in the pro file.
So your includepath's will be like : "/home/yourpath/linuxcnc/lib/" etc. Then it's ok.
It's a good practice, but reinstalling the iso takes 10 minutes, As the build-essentials for the rip are already in the iso.
--
As for the program, Tomorrow i am planning to bring 3 different app's together in one app.
1. Skynet app (opencascade viewer with robot model)
2. Kinematics app
3. Motionplanner app
This will save some hal pin's and i expect it will speed up the program a little bit.
The motionplanner is working with mdi command's for lineair moves now. I will pick this code up
later on again to finish a few things. For now it's ok.
Attachments:
Please Log in or Create an account to join the conversation.
My workflow would be,
1. unzip skynet.zip.
2. load project, build one time. (this creates the factoryapp.xml file for you).
3. copy the folders : gcode, hal, etc to your created build dir.
4. run program.
5. edit code to your wishes and compile frequently.
It seems I fixed the linker problems and I can now build Skynet.pro again and load the Kuka project.
So point 1 and 2 are done.
However I'm still confused as to what needs to be done to change the robot.
3. I copy the three folders "gcode" "hal" "robot" from /Desktop/Qt_skynet_app to /Desktop/build-Skynet-Desktop-Debug?
4. with "run program" do you mean to click on the "Run" (green triangle) button in qt-creator or run the file /Desktop/build-Skynet-Desktop-Debug/Skynet?
Thanks
Please Log in or Create an account to join the conversation.
I made a new project, that's a minimal example containing 5 c++ files.
Try to study this project. And try to add your own robot model into this project. I'm sure you can do this !
If you download this project .
github.com/grotius-cnc/Skynet_Robot_Cont.../releases/tag/1.0.21
It has a minimal code example, without xml file input etc.
Files like stepfiles are now automaticly copied to the build directory when you pressed the qt run button "cntr+r".
So you only have to use the source directory.
If you want to load your own robot model. The easyest way is to replace the current stepfile's with your robot files.
To edit your kinematic structure, see kinematic.cpp.
To edit the opencascade structure, see opencascade.cpp function : Update_jointpos() => edit framevector.
To edit your loaded stepfiles, see mainwindow.cpp.
In this example, also the hal files can be edited in qt creator see : Other files/config/ethercat.hal
Please Log in or Create an account to join the conversation.
Attachments:
Please Log in or Create an account to join the conversation.
- Qt is canOpen ready
- is possible to send command to Lcnc via server/client to halui for example
- nml Lcnc status and error maybe is needed for read a lot of status and error signal
- actual pos with ethercat is everytime usable in Qt without vcp or other similar widget on QtPy
I did not understand what happens here .... skynet uses nml, hal and Lcnc core or has the trajectory planner also been totally rewritten?
regards
bkt
Please Log in or Create an account to join the conversation.
I think you have to look at the pro.user file of the project. Some of the links over there have to be aligned with your file structure.
Hi Bkt,
is possible to send command to Lcnc via server/client to halui for example
nml Lcnc status and error maybe is needed for read a lot of status and error signal
Yes examples of interacting with halui and nml : github.com/grotius-cnc/QT_C-_Linuxcnc_interface_gui
actual pos with ethercat is everytime usable in Qt without vcp or other similar widget on QtPy
Yes, trough hal connection. Qt creates a hal component & pins in c++ to read the ethercat signals. In fact you signals are working
after the hal "net" is done, after that the hal realtime ready sign is given trough a system command in c++.
See examples in source code.
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???