学生休息室

分享学生如何在日常项目中使用MATLAB和SIMULINK的技术和现实示例金宝app

No Robot? No Problem! – Program Robots Using Simulations

Today,Jose Avendano Arbelaezshares another guest post with us. Make sure you let us know your thoughts in the comments section.

– –

机器人程序员一直在更加重视硬件和软件设计的模拟。以下是一些原因:

  1. You may not have available hardware, or selecting the right hardware depends on some initial analysis.
  2. You want to make sure your robot will behave as expected before testing on hardware. This will reduce the chances of putting unsafe code on your robots.

Because of these benefits of simulation, we have created tools to develop and test robotics algorithms in simulation. This post will help you get familiar with some of our robot simulation libraries.

Virtual Worlds – Dynamic 3D Visualizations

For many beginner robotics programmers, it is important to get immediate and accurate feedback on a robot’s behavior. TheRobotics Playgroundprovides a set of configurable virtual worlds. This is particularly useful if you are trying to move to which is a leading environment for controls design and robotics integration. You can testStateflowcharts for navigation and explore logic for moving objects. You can also close the loop and implement some robot perception by using multiple of the following available sensors:

  • Encoder
  • Distance sensor
  • Object sensor
  • Gyroscope
  • Compass
  • Contact switch
  • Lidar sensor

通过改变环境也可以修改the size, location and other properties of the 3D components directly from the Simulink blocks for any of the available environments.

If you are looking for a simple simulation environment in Simulink that includes physics, sensors, and rich visuals; theRobotics Playgroundis a great place to begin your journey. This library is also a great place to get started if you are planning to move your algorithms to Simulink-supported hardware like乐高,VEX, andArduino。Simulink can automatically generate and deploy production-ready code to supported hardware providing an effortless transition from simulation to hardware testing. These environments are built usingSimscape Multibody, if you are interested in physical modeling and simulation of 3D assemblies and environments, this library can also provide you with great reference examples.

Use Real-World Maps with Lines and Obstacles

Do you know what your environment looks like? TheMobile Robotics Training Toolboxcan create dedicated 2D maps for line following and obstacle avoidance from pictures of your actual robot field. This toolbox is the complement of ourMobile Robotics Trainingand it is especially helpful for developing and testing path navigation algorithms. You can check out our earlier post on非盟tonomous Navigation and Planningfor information on the training, but you can also just use the toolbox independently to simulate 2-Dimensional robot dynamics and perform early prototyping of supervisory logic. This Simulink toolbox comes with:

  • Robot visualizer
  • Line sensor
  • Encoder
  • Distance sensor
  • Kinematic utilities for differential drive robots
  • 从图片导入地图的申请

Before you get started with this toolbox, we encourage you to explore thetraining videoswhich have detailed lessons to follow along implementing all the toolbox functionality.

Prefer Working in MATLAB? Need Kinematic Models?

TheMobile Robotics Simulation Toolboxwas designed with MATLAB algorithm developers in mind. This toolbox includes:

  • Lidar sensor
  • Object detector
  • 机器人可视化器
  • Detailed examples
  • Kinematic models for:
    • Differential drive robot
    • Omnidirectional wheel robots
    • Mecanum wheel robots
    • 4-wheeled vehicles with steering

In this case, you also get important global measurements like the position and orientation of your robot and objects, and customizable 2D maps. Some of the examples in this toolbox include closed-loop waypoint tracking, object detection and following, and lidar navigation using several kinematic models. Our video onGetting Started with the Mobile Robotics Simulation Toolboxwill show you how install and use this toolbox. Additionally, all the contents of this toolbox have equivalent MATLAB and Simulink functionality so you can choose the programming approach you are most comfortable with, and get access to a rich library of models, sensors, and visualizations. TheMobile Robotics Simulation Toolboxis also well integrated with theRobotics Systems Toolbox。因此,您可以实现已安装的MATLAB库中包含的完整的接地车辆和映射算法。

Need More? Use ROS-Based Simulators

Once you move on to more advanced robotics applications you might need more detailed physics, higher customization, and likely faster execution. Many commercially available simulation environments have support for the Robot Operating System (ROS). If you are already working with a simulator such as Gazebo or V-REP you might consider developing your robot logic with MATLAB and/or Simulink. We have a lot of content demonstrating how to use model-based design to interact with both ROS-enabled robots and simulators. Check out our blog post onGetting Started with MATLAB, Simulink, and ROSwhich has anything you need to prototype, execute and deploy robot control algorithms and transport them to you preferred ROS platforms.

Conclusion

If you are at early development stages of your robot algorithms, need a way to test algorithms while your robots are being built, or simply just don’t have a robot to program; pre-built simulation libraries for MATLAB and Simulink for any experience level. Use the table below to match your simulation requirements to our available tools.

Robotics Playground

Mobile Robotics Training Toolbox

Mobile Robotics Simulation Toolbox

  • 3D Visuals
  • 可自定义的障碍物和对象图
  • Common robot sensors
  • Simulink library and MATLAB API
  • 2D Visuals
  • Common kinematic models
  • MATLAB and Simulink Libraries
  • Integrated with Robotics System Toolbox

More detailed environments, physics and robots?Getting Started with MATLAB, Simulink, and ROS

Testing your algorithms in simulation environments can help you get results faster and maybe even prevent potentially dangerous robot behavior. If you get a chance to try any of these toolboxes, let us know how they help you by writing tostudentcompetitions@mathworks.comor in the comments files below.

|

评论

To leave a comment, please click这里to sign in to your MathWorks Account or create a new one.