zoukankan      html  css  js  c++  java
  • 实操 | Simulating a Fetch robot in Gazebo

    Installation

    Before installing the simulation environment, make sure your desktop is setup with a standard installation of ROS Indigo on Ubuntu 14.04. Once your APT repositories are configured, you can install the simulator:

    $ sudo apt-get update
    $ sudo apt-get install ros-indigo-fetch-gazebo-demo

    Warning

    Never run the simulator on the robot. Simulation requires that the ROS parameter use_sim_time be set to true, which will cause the robot drivers to stop working correctly. In addition, be sure to never start the simulator in a terminal that has the ROS_MASTER_URI set to your robot for the same reasons.

    Starting the Simulator

    The fetch_gazebo and fetch_gazebo_demo packages provide the Gazebo environment for Fetch. fetch_gazebo includes several launch files:

    • simulation.launch spawns a robot in an empty world.
    • playground.launch spawns a robot inside a lab-like test environment. This environment has some tables with items that may be picked up and manipulated. It also has a pre-made map which can be used to test out robot navigation and some simple demonstrations of object grasping.

    To start the simplest environment:

    $ roslaunch fetch_gazebo simulation.launch
    

    Note that all of the environments will prepare the robot by tucking the arm and giving the head an initial command.

    Note: Possibly you don't see the lidar scan as in the above picture. That is because the default set of visibility of lidar scan is false. You can manually modify it in its .xacro file.

    $ roscd fetch_gazebo
    
    $ cd robots
    
    $ gedit fetch.gazebo.xacro

    locate "laser_link" block:

    modify this line:

    <visualize>false</visualize>

    as

    <visualize>true</visualize>

    Visualizing with RVIZ

    Even though Gazebo has a graphical visualization, RVIZ is still the preferred tool for interacting with your robot.

    $ rosrun rviz rviz
    

    You can now manually set up your RVIZ visualization or re-run RVIZ with a configuration file using the command line. The default .rviz configuration file for Fetch can be loaded using:

    $ roscd fetch_navigation/config
    $ rviz -d navigation.rviz

     To start with playground.launch:

    $ roslaunch fetch_gazebo playground.launch
    

    Check it in rviz:

    Running the Mobile Manipulation Demo

    There is a fully integrated demo showing navigation, perception and MoveIt! working together on the robot in simulation. To run the demo, start Gazebo simulator with the playground:

    >$ roslaunch fetch_gazebo playground.launch
    

    Wait until the simulator is fully running and then run the demo launch file:

    >$ roslaunch fetch_gazebo_demo demo.launch
    

    This will start:

    • fetch_nav.launch - this is the navigation stack with a pre-built map of the environment.
    • move_group.launch - this is the MoveIt configuration which can plan for the movement of the arm.
    • basic_grasping_perception - this is a simple demo found in the simple_grasping package which segments objects on tables and computes grasps for them.
    • demo.py - this our specific demo which navigates the robot from the starting pose in Gazebo to the table, raises the torso, lowers the head to look at the table, and then runs perception to generate a goal for MoveIt. The arm will then grasp the cube on the table, tuck the arm and lower the torso. Once the robot is back in this tucked configuration, the navigation stack will be once again called to navigate into the room with the countertop where the robot will place the cube on the other table.

    Reference:

    Fetch Robotics: Tutorial: Gazebo Simulation

     
  • 相关阅读:
    Leetcode NO.110 Balanced Binary Tree 平衡二叉树
    Leetcode NO.226 Invert Binary Tree 翻转二叉树
    Leetcode NO.215 Kth Largest Element In An Array 数组中的第K个最大元素
    根据特征的浏览器判断
    Cygwin在打开在当前目录
    【转帖】科学对待 健康养猫 打造快乐孕妇
    解决chrome浏览器安装扩展、应用程序一直处在“检查中”的问题
    对【SQL SERVER 分布式事务解决方案】的心得补充
    关于“点击这里继续访问您选择的百度XXX”
    VBA一例:如何保持文本框焦点
  • 原文地址:https://www.cnblogs.com/casperwin/p/6045514.html
Copyright © 2011-2022 走看看