Thursday, January 2, 2014

Garbage overflow 1, nothing much good out of it.

http://stackoverflow.com/questions/11068450/arduino-c-language-parsing-string-with-delimiter-input-through-serial-interfa
This is a useful post, what it says is this. Suppose I have three values separated by two commas or any other non alpha numeric character, what I need to do is, use the subString property. which has the syntax
substring variable.subString(from_point,to_point)
So, the example says first we identify where the given two commas are, by using the .indexOf
int commaindex=myString.indexOf(' ');
int secondcommaindex=myString.indexOf(' ', commanindex +1)

Now, we are using,

string str1=myString.substring(0,commaindex);
string str2=myString.substring(commaindex+1,secondcommaindex);
string str3=myString.substring(secondcommaindex); // this finishes till the end of the string.
// now convert the strings into numeric integers.
int phi= str1.toInt();
int theta=str2.toInt();
int psi=str3.toInt();
 Which brings us to the question How do we even get mystring in the first place?
off topic1: MeetAndroid.Send(value) sends something to the cellphone
http://www.instructables.com/id/Reverse-Engineering-Uzzors2k-Bluecar-Android-App/step1/Amarino/
this tells us that all of the previous things are not required. What we need is just an array, that makes the program damned simple.
http://www.controlguru.com/pages/table.html mentioned by Bret beauregard who wrote the PID autotune library as his teacher who's uploaded a great text cum course on practical aspects of control and real world data.

http://www.youtube.com/watch?v=dlOCuYqTEpI
This link provides an understanding of dynamics of machines by Prof. Amitabh Ghosh at I.I.T. Kharagpur. It explains relation between angular momentum, Ixx etc.

No comments:

Post a Comment