如何创造现实生活中的机器人?

发布于 2024-07-13 17:02:29 字数 356 浏览 8 评论 0原文

甚至在我学习编程之前,我就对机器人的工作方式着迷。 现在我知道底层编程指令是如何编写的,但我不明白的是机器人如何遵循这些指令。

例如,如果我编写了这段代码:

object=Robot.ScanSurroundings(300,400);
if (Objects.isEatable(object))
{
   Robot.moveLeftArm(300,400);
   Robot.pickObject(object);
}

CPU 如何执行该程序,使机器人做出向左看、移动手臂等物理动作? 主要是用二进制语言/ASM 完成的吗?

最后,如果我想学习如何创建机器人,我该去哪里?

Even before I learnt programming I've been fascinated with how robots could work. Now I know how the underlying programming instructions would be written, but what I don't understand is how those intructions are followed by the robot.

For example, if I wrote this code:

object=Robot.ScanSurroundings(300,400);
if (Objects.isEatable(object))
{
   Robot.moveLeftArm(300,400);
   Robot.pickObject(object);
}

How would this program be followed by the CPU in a way that would make the robot do the physical action of looking to the left, moving his arm, and such? Is it done primarily in binary language/ASM?

Lastly, where would i go if I wanted to learn how to create a robot?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

公布 2024-07-20 17:02:29

最后,必须将高级命令分解为非常低级的命令。 必须有某种东西将“拿起杯子”翻译为如何移动手臂(关节应处于什​​么角度)到实际转动电机的硬件命令。

有一些框架尝试提供一定量的这种翻译,包括(但不限于):

然而,由于机器人研究对每个领域都感兴趣,在系统层,提供整个翻译堆栈的系统并不多。 如果您正在考虑进入机器人技术,有几个系统试图让这变得更容易(再次是随机样本):

如果做不到这一点,可以访问 Make 甚至提供构建机器人项目的指南。 挑战是找到一个您感兴趣的项目,然后进城!

In the end, something has to break down the high level commands into very low level commands. Something has to translate "Pick up the cup" to how to move the arm (what angles the joints should be at) to the hardware commands which actually turn the motors.

There are frameworks which try to provide some amount of this translation, including (but not limited to):

However, since robotics research is interested in every layer of the system, there aren't many systems which provide the entire translation stack. If you're looking into getting into robotics, there are several systems which attempt to make this easier (again, a random sample):

Failing that, sites such as Make even provide guides to building robot projects to start from. The challenge is find a project which you are excited about, and go to town!

乙白 2024-07-20 17:02:29

您应该查看 Microsoft Robotics Studio (MRS)。 他们有很多视频/screencasts,以及书面教程。 此外,Channel9 还有关于机器人主题的许多视频、采访等。 包括演示,以及对MRS开发者的采访。

You should check out Microsoft Robotics Studio (MRS). They have many videos/screencasts, and written tutorials. Additionally, Channel9 has many videos, interviews, etc, on the robitics subject. Including demonstrations, and interviews with developers of MRS.

城歌 2024-07-20 17:02:29

在大多数现代机器人中,您将拥有机构的逆运动学模型(在本例中为手臂),它将空间坐标转换为手臂关节的位置。 这些关节通常由伺服电机移动。 为了平滑地移动手臂,您需要一系列中间关节位置来定义您希望手臂遵循的路径。 您还必须担心关节的速度,它们共同控制手臂末端“手”的速度。

当手臂移动时,您的伺服系统将获得有关其实际位置的反馈。 简单的伺服系统可以使用基本的 PID 反馈回路来调节电机。 更复杂的系统将包括补偿惯性、重力、摩擦等的前馈参数。 这些可能会变得非常复杂。

当您必须考虑到机器人周围空间中的障碍物时,真正的乐趣就开始了。 你必须感知障碍物并找出如何避开它并仍然到达目的地的方法。

In most modern robots you would have an Inverse Kinematic model of the mechanism, in this case the arm, that converts the spatial coordinates into positions for the joints of the arm. These joints are usually moved by servo motors. To smoothly move the arm, you need a series of intermediate joint positions defining the path you want the arm to follow. You also have to worry about the velocities of the joints, which together control the speed of the "hand" at the end of the arm.

While the arm is moving your servo system will be getting feedback about its actual position. Simple servo systems may use a basic PID feedback loop to adjust the motors. More complex systems will include feed-forward parameters which compensate for inertia, gravity, friction, and so on. These can become very sophisticated.

The real fun starts when you have to allow for obstacles in the space around the robot. You have to sense the obstacle and figure out how to avoid it and still reach the destination.

躲猫猫 2024-07-20 17:02:29

我只需添加一些关于 Arduino 项目 的内容,因为我没有看到上面提到的内容。

进入基于 Arduino 的机器人项目的门槛非常低。 您为硬件编写的“草图”程序非常容易上手,并且与 C 语法类似。 如果您不知道晶体管和电阻器,这些板仍然允许您使用插件硬件和附加的“shields”来完成很多工作 扩展基础计算机板。

它非常有趣、非常灵活,可以让您的代码与现实世界进行交互。 再加上它的“开放硬件”非常符合开源软件的风格。

I just have to add something about Arduino projects to this because I dont see it mentioned above.

There is a very low bar for entry into the Arduino based robotics projects. The "sketch" programs that you write for the hardware are very easy to pick up and similar to C syntax. If you dont know your transistors from resistors these boards still allow you to do alot with plug-in hardware and additional "shields" that extend the base computer board.

Its very fun, very flexible and something to get your code interacting with the real world. Plus its "Open Hardware" very along the lines of open source software.

魄砕の薆 2024-07-20 17:02:29

机器人将通过与硬件交互来工作。 代码中的桥接通常是通过不同类型的 I/O 端口完成的。 例如,它可能只是一根 RS232 电缆(您知道那些旧的 COM1 端口)。 硬件部分将由电机(如伺服电机)和传感器(如超声波感知障碍物,激光测距或开关)。

您不需要使用汇编程序来做到这一点,有很多语言(如果不是大多数)可以做到这一点,但它需要有关如何与硬件交互的知识。 就像编写驱动程序一样。 如果您想自己建造机器人,它至少也需要基本的电子设备。

如果您有兴趣,我建议您看一下这本书是一个很好的底漆。

另外,您可以尝试编写基本图章,按照教程操作非常简单,它会给您一个关于如何构建机器人的良好开端。 它不是太贵,而且您很快就可以与硬件进行交互。

祝好运并玩得开心点!

Robots will work by interacting with hardware. The bridge from your code is often done through different type of I/O ports. It could simply be a RS232 cable for example (you know those old COM1 ports). Hardware parts will be composed by motors (such as servo motors) and sensors (such as ultrasound to feel obstacles, lasers to get distance or switches).

You don't need to use assembler to do that, there are lots of languages (if not most) that can do it but it requires knowledge on how to interact with hardware. Like writing a driver. It requires at least basic electronics also if you want to build the robot yourself.

If you're interested, I suggest you have a look at this book which is a good primer.

Also, you could try out programming a Basic stamp, it's pretty easy following the tutorials and it will give you a good start on how to build robots. It's not too expensive and you'll be interacting with hardware in no time.

Good luck and have fun!

氛圍 2024-07-20 17:02:29

如果您的编程能力足够好,您可能会发现您实际上甚至不需要机器人来测试您需要编写的大部分最难的代码......(即,让机器人看到并识别一个总是令人着迷的场景我...但在某些时候,我意识到解决这个问题所需的物理机器人是简单的部分...软件是困难的部分!)...

If you get good enough at programming, you may discover that you don't even actually need a robot to test much of the hardest code you'll need to write... (IE, making a robot see and recognize a scene always fascinated me... But at some point, I realized that the physical robot required for this problem is the easy part... The software is the hard part!)...

怀中猫帐中妖 2024-07-20 17:02:29

也许更容易得到一种更高级的语言来描述机器人的行为和智能并让低级语言来执行动作(移动手臂、行走、停止)。 关于智能代理的 BDI 架构有很多研究,google 一下。

您可以在这个站点找到更多信息,它是一个用于描述用 Java 编写的代理行为的 DSL。 它被称为 Jason 解释器,语言是 AgentSpeak(L)。

Is probably easier to get a more high-level language to describe the robot's behaviors and intelligence and let the low level language to the actions (move arm, walk, stop). There is a lot of research in what is called BDI architecture for intelligent agents, google for it.

You can find more about at this site, it's a DSL for describing agent behavior made in Java. It's called Jason interpreter and the language is AgentSpeak(L).

阳光①夏 2024-07-20 17:02:29

寻找当地的 FIRST 机器人团队并自愿担任导师。 FIRST 是一项针对中学生和高中生的机器人竞赛。 我们的目标是让孩子们完成构建、编程、测试和运行机器人的所有工作,但您仍然有很多机会深​​入研究并真正学习软件。 他们正在使用 National Instruments 的 LabView,并且截至 2 月 8 日,刚刚开始区域竞争今年。 LabView 是一个图形化编程环境,可与 NI 硬件连接,让您对电机、执行器和传感器进行编程。 NI 的东西非常漂亮并且非常易于使用,而且它免费提供给每个团队,因此您不必自己购买硬件和软件(至少在开始使用时)。另外,您还可以获得以下额外好处:帮助新一代工程师开始他们的工作。

Find a local FIRST robotics team and volunteer to be a mentor. FIRST is a robotics competition for middle and high school kids. The goal is that the kids do all of the work to build, program, test, and run the robot, but you still will have lots of opportunities to dig in and really learn the software. They are using LabView by National Instruments, and, as of Feb 8, have just begun regional competition for this year. LabView is a graphical programming environment that interfaces with NI hardware to let you program motors, actuators, and sensors. The NI stuff is pretty slick and is pretty easy to use, plus it's provided free to each team, so you don't have to buy the hardware and software yourself (at least to get started.) Plus, you get the added bonus of helping a new generation of engineers get their start.

翻身的咸鱼 2024-07-20 17:02:29

您必须有一个与硬件连接的驱动程序(很可能是带有电机的 STAMP 或 FPGA 等)。 然后您可以调用函数 me.moveLeftArm(x,y); 并且驱动程序会知道 moveLeftArm() 意味着将执行器移动 X 秒/毫秒/度。

我确信您可以找到一个可以进行机器人编程的套件。

You would have to have a driver that interfaced with the hardware (most likely a STAMP or FPGA with motors etc...). You would then call the function me.moveLeftArm(x,y); and the driver would know that moveLeftArm() means to move an actuator for X seconds/milliseconds/degrees.

I'm sure that you could find a kit that does robot programming.

甜警司 2024-07-20 17:02:29

如果您想要 Java 替代方案,我可以推荐这本书 Linux Robotics。 它提供了大量关于从哪里获取套件、零件和传感器的有用信息,以及完整的 Java 源代码列表。

If you want a Java alternative, I can recommend the book Linux Robotics. It has a lot of good information about where to get kits, parts, and sensors, as well as complete source code listings in Java.

累赘 2024-07-20 17:02:29

我也有同样的渴望..我即将购买我的第一个 Beagle Board 和一些可以使用的传感器/伺服系统I2C 总线。 我将使用事件驱动的设计和纤维(原纤维,如果你愿意的话)的粗略实现,这是用户空间线程。

基本上,我的设计需要一个进程,该进程为每组伺服系统启动一个线程。 每个组管理器线程将启动 x # 的原纤维,每个伺服系统 2 个(可能)。 一根原纤维用于控制伺服系统,另一根原纤维处理来自该伺服系统的事件(即,物体太重而无法拾取、物体掉落等)。

主要流程的任务是监听其他所有事件,并确保在前进和克服障碍时“右手知道左手在做什么”。

我将花费两年的大部分时间才能让一些东西发挥作用,让我感到自豪……但我预计会有很多愉快的夜晚来实现这一点。

我很可能会使用微内核,而不是 Linux。

我这样做是为了通过事件驱动的方法来磨练自己,以及我制作自己的 R2 的愿望:)

I share the same itch .. I'm about to buy my first Beagle Board and some sensors / servos that can use the I2C bus. I'm going to be using an event driven design and a crude implementation of fibers (fibrils, if you will) which are userspace threads.

Basically my design calls for one process, which launches one thread per group of servos. Each group manager thread will launch x # of fibrils, 2 per servo (likely). One fibril is used to control the servo, the other fibril handles events from that servo (i.e., an object is just too heavy to pick up, an object was dropped, etc).

The main process has the task of listening for events from everything else and making sure the 'right hand knows what the left hand is doing' while moving forward and negotiating obstacles.

Its going to take me the better part of two years to get something working to the point that I'm proud of it .. but I anticipate many enjoyable evenings getting it to that point.

I will very likely be using a Microkernel, not Linux.

I'm doing this as much to sharpen myself with event driven methods as well as my desire to make my own R2 :)

就像说晚安 2024-07-20 17:02:29

如果您熟悉 .Net,请从 Phidets 开始。 您可以访问 TrossenRobotics.com 获取零件。

Phidg​​ets 接口套件是一个很好的起点。 从那里您可以获得伺服控制器并开始构建移动的东西。

Trossen 论坛也是审查其他人的项目的好地方。 他们还有一个新的数据中心,其中也包含代码/项目示例。 我不为他们工作......只是一个快乐的客户。

Start with Phidets if you are familiar with .Net. You can checkout TrossenRobotics.com for parts.

The Phidgets interface kit is a good place to start. From there you can get a servo controller and start building things that move.

The Trossen forums are also a good place to review other people's projects. They have a new Data Center with code/project samples too. I don't work for them...just a happy customer.

蔚蓝源自深海 2024-07-20 17:02:29

这里有很多好的答案。 您的幻想代码与您使用更高级语言(例如 MS Robotics Studio 上的 C#)的代码相差不远。 请记住,即使是简单的事情(例如“向左移动手臂”)也充满了“信息偏见”。

就金属而言,机械臂是一组连杆和[可能]机动关节。 因此,“向左移动手臂”(或坐标中的任何点)已经是一项非常复杂的计算任务(查找 D&H 表、操纵器的正向和逆向运动学)。

还有一个概念是,向左移动手臂假设该空间内没有任何东西,并且不会发生碰撞。 如果环境不受约束,那么您需要实现碰撞检测系统,通常基于某种传感器(相机)和机器视觉算法。

总之,与对系统进行建模以实现所需行为相比,语言和硬件接口通常是微不足道的。

lots of good answers here. your piece of fantasy code is not far from how you'd do in a higher level language such as C# over MS Robotics Studio. Just keep in mind that even simple things (like "move arm left") are very loaded with "information bias".

down to the metal, a robotic arm is a set of links and [possibly] motorized joints. Therefore "move arm left" (or any point in coordinate) is already a very complex task to compute (look for D&H Table, forward and inverse kinematics for manipulators).

There's also the concept that move arm left assumes there's nothing in that space and a collision won't occur. If the environment is unconstrained, then you need to implement a collision detection system, often based on some sort of sensor (camera) and machine vision algorithms.

In summary, the language and the hardware interfacing are often trivial compared to modeling the system to achieve the desired behavior.

请恋爱 2024-07-20 17:02:29

关于最后一个问题“如何创建机器人”,我发现从在 [Adafruit][1]、[Hackster.io][2] 甚至 [glitch][3] 等在线社区中寻找相关项目开始,或者寻找从头开始构建机器人的人的博客文章,例如 https://burningservos.com,或者提供文档和信息的产品 硬件和软件教程,例如 http://emanual.robotis.com /docs/en/platform/openmanipulator_x/overview/

Regarding the last question "how to create a robot", I find starting from looking for a related project in online communities like [Adafruit][1], [Hackster.io][2], or even [glitch][3], or looking for blog posts of someone who have built a robot from scratch, e.g., https://burningservos.com, or a product that provides documentations & tutorials for both hardware and software e.g., http://emanual.robotis.com/docs/en/platform/openmanipulator_x/overview/.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文