Java 机器人编程从哪里开始?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3372168/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 22:41:00  来源:igfitidea点击:

Where to begin with programming for robotics?

java.netcmicrocontrollerrobotics

提问by Julio

Ok so i've been interested in robotics for a while and had a project in mind. Building a small remote controlled vehicle-robot/ unmanned vehicle-robot. Hopefully with the ability to read in data from sensory devices(gps,thermometer etc) and write the data to some kind of device. The idea(s) had been on the backburner for a while until i just read the following article.

好的,所以我对机器人技术感兴趣有一段时间了,并有一个项目。建造一个小型遥控车辆-机器人/无人车辆-机器人。希望能够从传感设备(gps、温度计等)读取数据并将数据写入某种设备。这个想法已经搁置了一段时间,直到我刚刚阅读了以下文章

So my question is this. Where should I begin. I have absolutely no experience in this at all other than a few google searches and my project idea. I would like to play around with programming the micro controller boards. I know some java .net languages and some C.

所以我的问题是这个。我应该从哪里开始。除了一些谷歌搜索和我的项目想法之外,我完全没有这方面的经验。我想对微控制器板进行编程。我知道一些 java .net 语言和一些 C。

Any help on where to begin?

有关从哪里开始的任何帮助?

How do you design the robot, what steps do you go through from start to finish.

你是如何设计机器人的,你从头到尾经历了哪些步骤。

Thanks.

谢谢。

回答by Vokinneberg

回答by Bill the Lizard

Robocodeis a robotics simulation game, but it's a good place for a Java developer to start.

Robocode是一款机器人模拟游戏,但它是 Java 开发人员入门的好地方。

I can also recommend the books Linux Robotics: Programming Smarter Robotsand Robot Builder's Bonanzafor really good start-to-finish guides on building and programming robots.

我还可以推荐Linux Robotics: Programming Smarter RobotsRobot Builder's Bonanza这本书,它们是关于构建和编程机器人的非常好的从头到尾的指南。

Myke Predko also has a good book called Programming Robot Controllers.

Myke Predko 也有一本名为Programming Robot Controllers 的好书。

回答by Scott

Little setup to install, but this should offer you a lot of insight into what you want to learn, and offer genuine practice to reading robotic senors, interacting with their environments, etc.

很少需要安装,但这应该可以让您深入了解您想要学习的内容,并为阅读机器人传感器、与环境交互等提供真正的练习。

http://playerstage.sourceforge.net/

http://playerstage.sourceforge.net/

They offer a Java Framework (separate from the official supported Framework), that has it's own Sun Java documentation.

他们提供了一个 Java 框架(与官方支持的框架分开),它有自己的 Sun Java 文档。

http://sourceforge.net/projects/java-player/files/

http://sourceforge.net/projects/java-player/files/

回答by Matthew Whited

If you are interested in the programming side you can start with something like Lego MINDSTORMS. If you are more interested in the electronics side you may want to check out some of the kits on Parallaxand The Robot Store.

如果您对编程方面感兴趣,可以从Lego MINDSTORMS 之类的东西开始。如果您对电子产品更感兴趣,您可能需要查看ParallaxThe Robot Store上的一些套件。

You will find a mix of languages and platforms so really pick your favorite languages and find something in your price range. Robotics can be very fun (and very time consuming.)

您会发现多种语言和平台,因此请选择您最喜欢的语言并在您的价格范围内找到一些东西。机器人技术可能非常有趣(并且非常耗时。)

BTW, you can make a pretty cool robot with just an RC car and a BASIC Stamp. And if you have a parallel porton your computer you can interface your computer to the RC car for even more power.

顺便说一句,你可以用一辆遥控车和一个BASIC Stamp制作一个非常酷的机器人。如果您的计算机上有并行端口,您可以将计算机连接到遥控车以获得更大的功率。

回答by Joel

Lego Mindstorms is a surprisingly robust system, and lets you focus more on what you'd actually like to accomplish. There are systems which will let you program in something other than the visual language that comes with the kit, which I preferred.

Lego Mindstorms 是一个令人惊讶的强大系统,让您更专注于您真正想要完成的事情。有些系统可以让您使用套件附带的视觉语言以外的其他语言进行编程,我更喜欢这种语言。

Or you can get a starter kit from VEX, which will include either a PIC or a Cortex microcontroller, along with a programming system. The VEX kit is like an Erector set with brains and motors. :-)

或者,您可以从VEX获得入门套件,其中包括 PIC 或 Cortex 微控制器以及编程系统。VEX 套件就像一个带有大脑和马达的竖立装置。:-)

回答by advait

The Arduinois a verypopular platform among hobbyists. It's basically a programmable board with several inputs and outputs. I highly recommend starting out with it for its ease of use and large support community.

Arduino的是一个非常受摄影爱好者的流行平台。它基本上是一个具有多个输入和输出的可编程板。我强烈建议从它开始使用它,因为它易于使用且支持社区很大。

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments

Arduino 是一个基于灵活、易于使用的硬件和软件的开源电子原型平台。它适用于艺术家、设计师、业余爱好者以及对创建交互式对象或环境感兴趣的任何人

Several people have made tutorials on building robots with an Arduino as the controller. This oneis pretty cool.

有几个人制作了使用 Arduino 作为控制器构建机器人的教程。这个很酷。

回答by Staffan

Given that you want a remote controlled vehicle capable of moving around, you will obviously need some kind of motors. I going to assume it will have differential drivelocomotion since that's the simplest to build and very easy to control.

鉴于您想要一辆能够四处移动的遥控车辆,您显然需要某种电机。我将假设它将具有差分驱动运动,因为这是最简单的构建并且非常容易控制。

The simplest option is to get a pair of continuous hobby servos. They're cheap ($10 and up) and simple to drive through PWM (the duty cycle controls the velocity). If you want to step it up a bit you can get a pair of DC motors and encoders. You will need additional circuitry to drive them, but you can buy that ready made.

最简单的选择是获得一对连续的业余爱好舵机。它们很便宜(10 美元及以上)并且易于通过 PWM 驱动(占空比控制速度)。如果你想提高一点,你可以得到一对直流电机和编码器。您将需要额外的电路来驱动它们,但您可以购买现成的。

If you don't want it to be tethered you will need batteries and some kind of radio on board as well. If you're okay with not doing everything from scratch WiFi is the simplest solution in my opinion since you don't need any extra equipment on the computer you're using; it does tend to limit your "computer" and software options though (you'll want to run e.g. Linux on it).

如果你不希望它被拴住,你还需要电池和某种收音机。如果您可以不从头开始做所有事情,我认为 WiFi 是最简单的解决方案,因为您在使用的计算机上不需要任何额外设备;不过,它确实会限制您的“计算机”和软件选项(您将希望在其上运行例如 Linux)。

You'll want an MCU/board that has:

您需要一个具有以下特性的 MCU/板:

  • PWM, for driving your servos/motors
  • A/D if you have analog sensors
  • A bunch of digital I/Os for whatnot
  • Built-in WiFi or a way to interface your WiFi card (USB, mini-PCI)
  • SPI/I2C and UARTs for various peripherals
  • PWM,用于驱动您的伺服器/电机
  • A/D 如果您有模拟传感器
  • 一堆数字 I/O 什么的
  • 内置 WiFi 或连接 WiFi 卡的方式(USB、迷你 PCI)
  • 用于各种外设的 SPI/I2C 和 UART

Having USB host signals has the added advantage that it's easy to hook up cheap cameras.

拥有 USB 主机信号还有一个额外的优势,即可以轻松连接廉价相机。

Something like the Roboardfits the bill (they also sell a mini-PCI wifi card). It packs plenty of computing power (and unlike many of the simpler boards, it has an FPU!), has plenty of connectivity options, including USB, and comes with a user space library to control the peripherals. (Disclaimer: I haven't tested it myself.)

Roboard这样的东西符合要求(他们还出售迷你 PCI wifi 卡)。它具有强大的计算能力(与许多更简单的板不同,它有一个 FPU!),有很多连接选项,包括 USB,并带有一个用户空间库来控制外围设备。(免责声明:我自己没有测试过。)

It's not the cheapest hardware you can get, but it should have room to grow in if you want to try the more computing intensive parts of robotics (like SLAM, computer vision and motion planning). On the up side, you don't have to build a programmer/debugger for it.

它不是你能得到的最便宜的硬件,但如果你想尝试机器人技术中计算密集程度更高的部分(如 SLAM、计算机视觉和运动规划),它应该有增长的空间。从好的方面来说,您不必为它构建程序员/调试器。

If you'd rather start out simple, getting a cheaper board like the Arduinothat someone already mentioned might be a better option. Using a simulator is also good to test out the software aspects before investing in hardware.

如果您更愿意从简单开始,那么购买像Arduino这样更便宜的板(有人已经提到过)可能是更好的选择。在投资硬件之前,使用模拟器也可以很好地测试软件方面。

Where to start on the software side depends on what you're interested in.

在软件方面从哪里开始取决于您对什么感兴趣。

回答by Roger F. Gay

I'll add a vote for LEGO robots just to get started, but how are you as a programmer? If you want to break out on your own, you can load LeJOS onto the LEGO "brick" (you'll know that that means when you look into it) and run your own Java programs on your computer that will interact / control the LEGO robot directly.

我会为乐高机器人投上一票,只是为了开始,但你作为一名程序员如何?如果你想自己突破,你可以将 LeJOS 加载到乐高“积木”上(你会知道这意味着当你查看它时)并在你的计算机上运行你自己的 Java 程序来交互/控制乐高机器人直接。

Also - if you are a programmer you may want to look at the High Level Logic (HLL) Open-Source Project. The code hasn't reached version 1.0 yet, but there was a robotics demo in the prototype, and a LEGO with LeJOS waiting in the wings.

此外 - 如果您是一名程序员,您可能想查看高级逻辑 (HLL) 开源项目。代码还没有达到 1.0 版本,但原型中有一个机器人演示,还有一个乐高积木,乐高正在等待中。

LEGO Mindstorms NXT Robots (leJOS) - (Dynamic graphic in the article only works properly on Firefox.) http://highlevellogic.blogspot.com/2010/10/lego-mindstorms-nxt-robots-lejos.html

LEGO Mindstorms NXT Robots (leJOS) -(文章中的动态图形仅适用于 Firefox。) http://highlevellogic.blogspot.com/2010/10/lego-mindstorms-nxt-robots-lejos.html

回答by Bradley Powers

If you want to do it right, and develop skills that will serve you well in the robotics industry going forward, I recommend trying ROS. ROS, the "Robot Operating System" isn't actually an operating system at all (in fact, it's commonly run on Ubuntu). It's an Inter-Process communication system, a set of build and debug tools, and an incredibly large library of excellent drivers and algorithms.

如果你想把事情做好,并培养在未来机器人行业中为你服务的技能,我建议尝试 ROS。ROS,“机器人操作系统”实际上根本不是操作系统(实际上,它通常在 Ubuntu 上运行)。它是一个进程间通信系统、一组构建和调试工具,以及一个非常大的优秀驱动程序和算法库。

To get started without a physical robot, you can start with any of a number of simulated robots in the Gazebo simulator. This will let you get started with algorithm development and such without a large investment of time or money. Tutorials and getting started guides can be found at ros.org.

要在没有物理机器人的情况下开始,您可以从 Gazebo 模拟器中的许多模拟机器人中的任何一个开始。这将使您无需投入大量时间或金钱即可开始算法开发等。教程和入门指南可以在ros.org上找到

Good luck!

祝你好运!