Java or C++ for Robot programmeng?

In summary, the conversation discusses a dilemma in choosing a programming language for a mobile robot designer. The designer is considering between C++ and Java and is looking for the most suitable language for complex navigation algorithms and localization strategies. They have experience in both languages but are unsure about the performance on different processors. The conversation also includes a personal experience of using C/C++ for a quad-copter and the factors that influenced the decision. Ultimately, the designer is seeking opinions on which language would be the best choice for their project.
  • #1
matinking
17
0
Hi everyone!

I am a mobile robot designer in autonomous space robotics. there is a great dilemma in front of me to opt a programming language for the robots between C++ and Java.
the most important factor for me is performance of the language when i want to use it for applying very complicated navigation algorithms and very sophisticated localization strategies, for example.
I have experience in working both of them. I got Java more interesting but because of the special compiling process which it has, I feel that it could be run on the PC slower than C++!
I've tried to investigate about them collected the opinions of the other and find somethings but they couldn't help me deciding.
for example:

many of the programmers think that java is faster and have better performance whereas I found it slower...! of course, there is a very important thing. I finally want to program my on a ARM microprocessor or a DSP and I'm not sure that java is slow on them too or not!

but the others think that C++ is more powerful than all languages such as java and its operation is better than Java noticeably. furthermore, descendent of the C++ in design of different robotic packages is undeniable.

All in all, what is your opinion? which one could be the best choice for me?

Thank you!
 
Technology news on Phys.org
  • #2
Hi matinking,

I have some experience in quad-copter algorithms and a bit of experience in localization.
I use C/C++ for the quad-copter I am developing and it is for some specific reasons.
Java is a easy programming language. Yes it has many features and can be very powerful.
Although if you want to make Java fast you need to be a Pro in Java knowing all its features.
I experienced that Java is slow in the simplest calculations and tasks.

Like I said I use C for my quad-copter because it is faster in the tasks it needs to perform.
Like writing files, writing registers and reading buffers.
I use C++ for some visualisation and logging it has to do.
Furthermore it supports pointers which is the big thing in Embedded Systems.

I hope I helped you making a decision.
If you have any questions, feel free to ask!
btw. my quadcopter is running on a ARM-cortex A8.

Good luck,
Zakaria
 
  • Like
Likes Tosh5457
  • #3
ZlBarnoussi said:
I hope I helped you making a decision.

Look at the date on his post. I hope he's not still trying to make up his mind after more than three years. :biggrin:
 

Related to Java or C++ for Robot programmeng?

1. What is the main difference between Java and C++ for robot programming?

Java and C++ are both high-level programming languages commonly used for robot programming. The main difference between the two is that Java is an object-oriented language while C++ is a multi-paradigm language. This means that Java is better suited for large-scale projects with complex code structures, while C++ is more versatile and can be used for a wider range of applications.

2. Which language is more commonly used for robot programming?

Both Java and C++ are widely used for robot programming. However, Java is more commonly used in the industry due to its robust object-oriented design and compatibility with various platforms. C++ is also popular among experienced programmers as it offers more control and performance optimization options.

3. Do Java and C++ have different libraries and tools for robot programming?

Yes, Java and C++ have different libraries and tools for robot programming. Java has a larger standard library which includes built-in functions and classes for various tasks, making it easier to write and maintain code. C++ has a smaller standard library but offers access to a wider range of third-party libraries and tools for more specialized tasks.

4. Is one language easier to learn than the other for robot programming?

This is subjective and depends on the individual's background and experience. Generally, Java may be easier to learn for beginners due to its simpler syntax and built-in memory management. However, C++ may be more challenging to learn but offers more control and flexibility once mastered.

5. Can Java and C++ be used together for robot programming?

Yes, Java and C++ can be used together for robot programming. They can be integrated using libraries and tools such as Java Native Interface (JNI) or Remote Procedure Call (RPC). This allows developers to combine the strengths of both languages for more efficient and powerful robot programming.

Similar threads

  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
3
Views
3K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
14
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
18
Views
1K
  • Programming and Computer Science
Replies
18
Views
8K
Back
Top