zoukankan      html  css  js  c++  java
  • argos3-simulator

    如何修改控制器:

    CVector2:

     class CVector2 {
       
       friend class CRotationMatrix2;
       friend class CTransformationMatrix2;
    
       public:
    
          /** The <em>x</em> axis */
          static const CVector2 X;
    
          /** The <em>y</em> axis */
          static const CVector2 Y;
    
          /**
           * Class constructor.
           * It initializes the vector to (0,0).
           * @see ZERO
           */
          CVector2() :
             m_fX(0.0),
             m_fY(0.0) {
          }
    
          /**
           * Class constructor.
           * It initializes the vector from Cartesian coordinates.
           * @param f_x The <em>x</em> coordinate.
           * @param f_y The <em>y</em> coordinate.
           * @see Set()
           */
          CVector2(Real f_x,
                   Real f_y) :
             m_fX(f_x),
             m_fY(f_y) {
          }
    /**
    * Sums the passed vector to this vector.
    * @param c_vector2 The other vector.
    * @returns A reference to this vector.
    */
    inline CVector2& operator+=(const CVector2& c_vector2) {
    m_fX += c_vector2.m_fX;
    m_fY += c_vector2.m_fY;
    return *this;
    }
    ......
    };
     1  struct SReading {
     2          CRadians Angle;
     3          Real Distance; // in cm from the center of the robot (about 10cm from the border)
     4 
     5          SReading() :
     6             Angle(0.0f),
     7             Distance(0.0f) {}
     8 
     9          SReading(const CRadians& c_angle,
    10                   Real f_distance) :
    11             Angle(c_angle),
    12             Distance(f_distance) {
    13          }
    14       };
    15   typedef std::vector<SReading> TReadings;

    参考:https://git.mistlab.ca/isvogor/e-pucky/tree/260fc947afde2a04132b71c79d4204629419b576/swarms/controllers/cpp/collision_avoidance

    锁定修改文件:footbot_diffusion_reference.cpp

    读懂每个文件的函数意义:

    Swarmanoid hardware

    Foot-bots

     

    The foot-bot is a particular configuration of modules based on the marXbot robotic platform. The foot-bot configuration includes a top CPU and vision module, a distance scnaner, a range and bearing module, a self-assembling module and a basic (mobility & battery) module.

     

    Foot-bot Features:

     
    • Compact size: 直径17 cm x 29 cm, 1.8 kg
    • Modular system
    • High computational power including float processing
    • Distance scanner measuring distance up to 1.5m
    • Two cameras, one mounted as omnicamera
    • Self-assembling mechanism
    • Hot-swappable battery
    • Treel mobility system

    IR-sensor:https://www.electronicshub.org/ir-sensor/

    有8个IR-sensor,搞不明白怎么测量的角度?

    The returned data of each sensor is

    • A reading (a decaying exponential) that depends on the distance between the sensor and the object being detected. This reading is 0 when nothing is detected, and it increases exponentially to 1 when detected objects are closer.
    • The angle is measured between the nose of the robot (local X axis) and the angle at which the sensor is located on the body of the robot.

    所以,靠的是机器人身上的传感器的位置来计算的正面与障碍物的角度。

  • 相关阅读:
    20160419—JS备忘:服务器回发刷新页面提示重试的解决方案。
    JS备忘--子父页面获取元素属性、显示时间,iframe之间互相调用函数
    20160215--获取页面的高度和宽度
    20151013--设计模式六大原则(转载)
    20150915--文件下载
    20150909—Win10系统80端口被System占用
    GridView中实现CheckBox的全选
    Invoke和BeginInvoke的区别(转载)
    AJAX+图像验证码(一般处理程序)
    报表
  • 原文地址:https://www.cnblogs.com/snowdwq/p/9926111.html
Copyright © 2011-2022 走看看