harunbas141
Posts: 2
Joined: Fri Apr 15, 2016 10:17 pm

C/C++ for Robot Programming

Fri Apr 15, 2016 10:30 pm

Hi,Everyone.
First of all sorry for my English because it is not my mother tongue.
I am from Turkey and living in Istanbul.This is my first year at my university.My branch is computer engineering.We started to learn coding with C++.Before C++, we tried to learn algorithm and logic of programming.We came over to how to use funcitions in C++.
And we are doing well on it.
But i have a question about C++.I want to learn robot programming.I searched in internet.I found many contents but not a way to learn.Some of my friends said that Raspberry Pi is a good start for it.And now I am here and asking to you.
I am trying to learn Linux and programming in Linux with C++.Also i am trying to learn how to use Linux and commands for Terminal.So any ideas?

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: C/C++ for Robot Programming

Sun Apr 17, 2016 1:19 am

Go here and download some old issues of The MagPi: https://www.raspberrypi.org/magpi/issues/
Start with number one, there are tutorials for using the commandline, how to compile programs and how to connect sensors/motors etc.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: C/C++ for Robot Programming

Sun Apr 17, 2016 10:56 am

Before starting with the Pi, I have been programming robots of different MCU platforms in C (or even "not-quite-C"), e.g., Arduinos and Lego Bricks (RCX, NXT, and partially EV3).
But to deal with all the complicated Linux skills that one needs for the Raspi first knocked me out - it took me several months for the first successfull steps to achieve.

The main difficulty was the lack of a coherent step-by-step-Tutorial and Manual to set up a C/C++ environment and how to write C programs like it is provided for Arduino by Arduino.cc.
As I didn't find one, I laboriously searched and picked up anything what I could find and what people kindly posted me when asking e.g., in this forum and others.

I wrote down what I found and read and heard and made sort of a
Quick Guide to C/C++ for Raspberry Pi,
using the Geany IDE, openVG graphics, wiringPi and pigpio GPIO libraries, UART, I2C, Multitasking, and more, and it's main purpose is for robot programming.
http://www.mindstormsforum.de/viewtopic ... 689#p67768

It's written in my mother tongue, i.e. German, many things could not be resolved yet, many are under construction (and not sure if they ever can be finished, e.g., the Pi Cam), but perhaps you'll understand it and might find it helpful nevertheless.

HTH!


(edited, typo)
Last edited by davenull on Mon Apr 18, 2016 8:04 am, edited 1 time in total.
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

harunbas141
Posts: 2
Joined: Fri Apr 15, 2016 10:17 pm

Re: C/C++ for Robot Programming

Mon Apr 18, 2016 7:48 am

thanks for helping and giving sources.

Return to “C/C++”