Author Topic: Programm language for robotic  (Read 539 times)

0 Members and 1 Guest are viewing this topic.

Offline Irukandji

  • Contributor
  • Posts: 23
  • Country: de
Programm language for robotic
« on: July 19, 2019, 12:15:12 pm »
Hi guys,
i want to learn a programming language. Which language i must learn for programming robots or autonomous cars? Can i learn robotic language with an Arduino?

best regards
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 5711
  • Country: us
    • Personal site
Re: Programm language for robotic
« Reply #1 on: July 19, 2019, 06:14:07 pm »
C/C++/Python. Arduino - depends on the depth you want to go. You definitely can't do anything close to modern understanding of an "autonomous car", but you can do basic robotics stuff.
Alex
 

Online techman-001

  • Frequent Contributor
  • **
  • Posts: 353
  • Country: au
  • Electronics technician for the last 47 years
Re: Programm language for robotic
« Reply #2 on: July 19, 2019, 10:22:37 pm »
Hi guys,
i want to learn a programming language. Which language i must learn for programming robots or autonomous cars? Can i learn robotic language with an Arduino?

best regards

Forth of course, Arduino is for artists who want a quickly built light display for their ice sculpture etc.

With Forth you can leverage the inbuilt programmer machine interactivity using Words like  " 30 forward", 100 left" for robots,  plus Forth is big in Germany, see the German Forth Org  https://forth-ev.de/

Autonomous cars ? Join Google or Tesla or a university as this isn't a hobby area and would be controlled by all kinds of safety and government regulations.

Offline TK

  • Super Contributor
  • ***
  • Posts: 1098
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: Programm language for robotic
« Reply #3 on: July 19, 2019, 11:53:05 pm »
For simple robots, probably Arduino is the best option.  For autonomous driving robots: python because of the extensive deep learning frameworks available for python.
 

Offline Irukandji

  • Contributor
  • Posts: 23
  • Country: de
Re: Programm language for robotic
« Reply #4 on: July 20, 2019, 08:59:14 am »
Thanks so much for your help. If i understand it right, it would be helpful to understand python and c or c++ programming language. Plus Forth i never hear that before thanks.
 

Online techman-001

  • Frequent Contributor
  • **
  • Posts: 353
  • Country: au
  • Electronics technician for the last 47 years
Re: Programm language for robotic
« Reply #5 on: July 20, 2019, 09:11:38 am »
Thanks so much for your help. If i understand it right, it would be helpful to understand python and c or c++ programming language. Plus Forth i never hear that before thanks.

Eight Forth powered MCU's were on the Philae Lander robot that accompanied the Rosetta spacecraft until it separated to land on comet 67P/Churyumov–Gerasimenko, in
12 November 2014.

Offline Doctorandus_P

  • Frequent Contributor
  • **
  • Posts: 579
  • Country: nl
Re: Programm language for robotic
« Reply #6 on: July 22, 2019, 10:15:09 am »
A programming language is just a programming language.

"arduino" is not a programming language.

That said. The language itself is not a very important factor.
Probably a lot more important are the tools and libraries available in the language you want to use, and if that language fits with your personality.

[Python rant]
For example, there are a bunch of reasons I quite dislike Python, such as the complete dependence on whitespace, the lack of strong typing and variable declaration (A single typo will just create a new variable instead of generate a syntax error, and may go unnoticed untill that line of code is actually executed, which easily creates hard to find bugs Yuck). But I am still interested in Python because it seems to become the defacto standard language for scripting stuff (KiCad, FreeCAD, Sigrok, etc).
[/Python rant]

Your choice may also depend on what sort of "robot" you want to build. From small carts such as line following carts or "micro mouse" to the autonomous vehicles that are tle latest craze in the last few years. Or are you more interested in "industral type" robot arms?

Search the web a bit for projects similar to your interest, and look at the available documentation / libraries / etc.
You can also do some searches on sites such as github and gitlab. There is a lot of code over there, and such sites are not well indexed by regular search engines.
Hackaday also has a quite extensive overview of all kind of robotic related projects:
https://hackaday.com/?s=robot

Last but not least, have a look at Robot Operating System (ROS)
http://www.ros.org/
https://rosindustrial.org/





 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 9021
  • Country: my
  • reassessing directives...
Re: Programm language for robotic
« Reply #7 on: July 22, 2019, 10:51:02 am »
always C/C++.... i can command the robot to goto(x,y) with my dead reckon and sensories library, i can do deep learning with proper library downloaded from the net and installed, i can show my face old 50 years from now, if i know the algorithm... if you want a working robot while you wiggle your foot on the chair (aka very little work), just buy a ready made robot.
if something can select, how cant it be intelligent? if something is intelligent, how cant it exist?
 

Offline raptor1956

  • Frequent Contributor
  • **
  • Posts: 790
  • Country: us
Re: Programm language for robotic
« Reply #8 on: July 30, 2019, 01:39:09 am »
Most commercial robots from companies like Fanuc or Kuka have there own programming environment allowing the user to program in a Basic like way using a teach pendant and robot specific operators/commands.  Interfacing to them is a different issue with the various flavors of C being dominant. 


Brian
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 2654
  • Country: us
Re: Programm language for robotic
« Reply #9 on: July 30, 2019, 02:38:58 am »
Hi guys,
i want to learn a programming language. Which language i must learn for programming robots or autonomous cars? Can i learn robotic language with an Arduino?

best regards

re: "...autonomous cars..."

First, Arduino is not a language.  Second, I don't think Arduino will ever be a good answer for "autonomous cars".  Arduino is a specific implementation of a MCU (computer) to do experimentation and education.  It is a simple implementation of hardware (MCU) and software working together.  I can for example do some simple input (sensors), make some decision, and do some hardware effect (such as showing the sensor value or turning on a light).  The hardware capabilities is very limited even with the "bigger better" Arduino boards.  The space to store program is also very limited.

The Arduino implementation choose C++ as the language it used to program the MCU.  "Autonomous cars" will need far more hardware and far more software capabilities than what is available in the Arduino environment.
 

Offline kenshi

  • Contributor
  • Posts: 9
  • Country: us
Re: Programm language for robotic
« Reply #10 on: August 05, 2019, 12:39:58 pm »
Industrial robots have their own languages, and they're pretty easy in my experience. I play with ABB robots, which use RAPID. It's an interpreted procedural language that mostly uses move and I/O commands, so if you know one or two computer programming languages, you can pick up on the basics like syntax extremely quickly and just read the manual on instructions, functions, and data types for the details.

For instance, a function that makes a single weld on a part might be something like this:

PROC Weld_Side_A

Set roInFixtureA;
Move WeldA1, v2000, z200, tMIG_TORCH;
Move WeldA2, v300, z50, tMIG_TORCH;
ArcLStart w101_start, v50, fine, wd101, sd101, tMIG_TORCH;
ArcLEnd w101_end, v200, fine, wd101, sd101, tMIG_TORCH;
Move WeldA2, v50, z50, tMIG_TORCH;
Move WeldA1, v300, z50, tMIG_TORCH;
Reset roInFixtureA;
PulseDO \PLength:=1.0,roWeldAComplete;
MoveJAbs pHome, v2000, fine, tMIG_TORCH;

END PROC

Pretty simple. It starts off telling the PLC that it's in fixture A so it doesn't try to open the clamps or anything. Then there are some move commands which have as parameters a position, speed, flyby zone, and the tool being used. The flyby zone gives a radius around a point in which it can curve to change trajectory for the next point. Fine means it has to go to that exact point. There are ArcLStart and ArcLEnd instructions to start and end a straight line MIG weld, respectively. They have the same parameters as the Move commands but add welddata and seamdata which contain weld parameters. The flyby zone is fine so the weld starts and stops in a predictable position. Then you let the PLC know the robot is no longer in the fixture and that it completed the weld by pulsing that output on for one second. Finally the robot goes home. (You use MoveJAbs for that because the home position uses a data type for the position that has the angles for each joint of the robot instead of the intended location and angle of the tool.

Anyway, that's a pretty simple weld procedure to give you an idea. I think learning pretty much any computer language will make learning something like RAPID a piece of cake.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 6249
  • Country: us
Re: Programm language for robotic
« Reply #11 on: September 05, 2019, 06:09:25 pm »
If you're starting from nowhere, you might as well start with the Arduino platform using the C language.  The Arduinno libraries are indeed written in C++ but most of the user code I have seen is written in C.  When somebody wants to propose a language, see how many operating system kernels are written in the language.  Then look at Real Time Operating Systems (RTOSs) and see which languages are used.  Python won't show up, neither will Fortran.  I would be amazed if C++ showed up.  Fast code is written in C.  It started with Unix and it is still true today.

There are thousands of Arduino projects on the Internet.  Everything that can be done, has been done.  It's all out there!

Later on, after mastering the Arduino, you can transition to the underlying avr-libc libraries and write code directly for the ATmega328P.  You can get as detailed as you want and the chip is pretty amazing for what it is.  There are larger variants of the ATmega chip family and all are supported by avr-gcc (the compiler/linker) and avr-libc (the C library).

You will be working at the lowest level of automation, sensors and actuators.  You won't be doing high level stuff like curing world hunger.  These, and similar, processors are intended to control.  Don't be surprised when you find out there are more than 100 such processors in the modern automobile.  Divide and conquer!  It's cheaper to build 100 small systems than it is to incorporate all the logic into a single processor, even if it is orders of magnitude more capable.

Eventually, you will migrate to one of the ARM processors.  Maybe the Teensy 4.0 which is a blazing fast (600 MHz) ARM processor with gobs of memory (like 2 MB of flash memory for code and 1 MB of RAM).  Why would you gravitate to this platform?  Well, there's a plug-in for the Arduino toolchain and the TeensyDuino provides all the Arduino library functions rewritten for the ARM.  User code can be written that runs on both the ATmega and the Teensy platform, unchanged.  Not all code, of course,  particularly not low level code, but a lot of the standard functions (A/D, PWM, Serial) all work.

Or you could skip the ATmega328P experience and move straight to the Teensy.  It is essentially pin compatible (compare to Arduino Nano), it is source code compatible (for the most part) and it has a LOT more memory and a much brighter future.  It's $20.

https://www.pjrc.com/store/teensy40.html

I have 3 of these.  I used to have 4 but my dog thought the prototype board would make an excellent chew toy!

I like the 'stamp' format that is compatible with prototype boards.  The more I think about it, the more convinced I become that skipping the ATmega328P and going for the Teensy 4.0 is the right way to go.  Cheap, fast and lots of memory!
« Last Edit: September 05, 2019, 06:21:16 pm by rstofer »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 2801
  • Country: fr
Re: Programm language for robotic
« Reply #12 on: September 09, 2019, 04:08:53 pm »
The Arduinno libraries are indeed written in C++ but most of the user code I have seen is written in C.

Yup. Well, the Arduino "framework" uses a very small subset of C++ from what I've seen, mainly to make use of namespaces (which C definitely lacks) and basic class stuff.

Or you could skip the ATmega328P experience and move straight to the Teensy.  It is essentially pin compatible (compare to Arduino Nano), it is source code compatible (for the most part) and it has a LOT more memory and a much brighter future.  It's $20.

I personally never recommend using the Arduino platform ( ;D ), but if you want to, I definitely agree with you there. Many MCUs are now supported by Arduino. At least pick some that are reasonably powerful and modern.
 

Online legacy

  • Super Contributor
  • ***
  • Posts: 4088
  • Country: ch
Re: Programm language for robotic
« Reply #13 on: September 09, 2019, 07:15:00 pm »
A couple of kits by NVIDIA for machine vision and machine learning are based on a C++ SDK and C++ frameworks.


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf