Skip to content

Latest commit

 

History

History
168 lines (105 loc) · 5.58 KB

node_api.md

File metadata and controls

168 lines (105 loc) · 5.58 KB

Node API

Parameters

  • serial_port(string, default: "/dev/serial_sdk")

    Serail port path of usb device. If udev rule correctly configured, the path is mapped to "/dev/serial_sdk" as default.

  • load_module(list, default: ["chassis", "gimbal", "referee_system"])

    Loading modules of AI Robot.

Module chassis

Subscribed Topics

  • cmd_vel (geometry_msgs/Twist)

    Chassis velocity command, the chassis is moving at the given speed in the next control cycle.

  • cmd_vel_acc (roborts_msgs/TwistAccel)

    Chassis velocity and acceleration command, the chassis performs a uniform acceleration motion at an initial given speed in the next control cycle.

Published Topics

  • odom (nav_msgs/Odometry)

    Chassis odometry information with translation calculated from motor encoder and rotation calculated from gyro.

  • uwb (geometry_msgs/PoseStamped)

    Pose information of the chassis in the UWB coordinate system.

  • tf (tf/tfMessage)

    Publishes the transform from base_link to odom.

Module gimbal

Subscribed Topics

  • cmd_gimbal_angle (roborts_msgs/GimbalAngle)

    Gimbal angle command, if yaw_mode/pitch_mode is set, the yaw_angle/pitch_angle represents relative control angle.

Published Topics

  • tf (tf/tfMessage)

    Publishes the transform from base_link to gimbal.

Services

  • cmd_fric_wheel (roborts_msgs/FricWhl)

    Start and stop the friction wheel.

    If you want to change the shoot speed(friction wheel motor speed), please change the value of fric_speed (normally from 1200 to 1500) in the gimbal.cpp and rebuild the package.

        fric_speed.left = 1240;
        fric_speed.right = 1240;

    The default value is 1240 and shoot speed is about 8 m/s.

  • cmd_shoot (roborts_msgs/ShootCmd)

    projectile shoot command with given mode and number.

Module referee system

Published Topics

  • game_result (roborts_msgs/GameResult)

    Game result information:

    Result Description
    0 Draw
    1 Red Wins
    2 Blue Wins
  • game_robot_bullet (roborts_msgs/GameRobotBullet)

    Game robot remaining bullet information of four robots.

  • game_robot_hp (roborts_msgs/GameRobotHP)

    Game robot health point information of four robots.

  • game_status (roborts_msgs/GameStatus)

    Game status with its remaining time information.

    Status Description
    0 Ready
    1 Preparation
    2 Initialize
    3 Five Second CD
    4 Game
    5 End
  • game_zone_array_status (roborts_msgs/GameZoneArray)

    Six game zone status with its type and activation flag. The type information is as follow:

    Status Description
    1 Red HP Recovery
    2 Red Bullet Supply
    3 Blue HP Recovery
    4 Blue Bullet Supply
    5 Disable Shooting
    6 Disable Movement
  • lurk_status(roborts_msgs/LurkStatus)

    Indicates whether the current game is in lurking mode.

    Status Description
    0 normal
    1 ready to lurk
    2 lurking
  • robot_damage (roborts_msgs/RobotDamage)

    Robot damage type information:

    Damage Type Description
    0 Armor
    1 Offline
    2 Exceed Shoot Speed
    3 Exceed Shoot Heat
    4 Exceed Chassis Power
    5 Obstacle Collision

    and damage source (armor id) if damage type is armor :

    Damage Source Description
    0 Forward
    1 Left
    2 Backword
    3 Right
  • robot_heat (roborts_msgs/RobotHeat)

    Chassis voltage, current, power information and shooter heat information

  • robot_shoot (roborts_msgs/RobotShoot)

    Robot shoot frequency and speed information

  • robot_status (roborts_msgs/RobotStatus)

    Robot status information including

    • id,
    • level,
    • remain and max health point,
    • heat information
    • gimbal, chassis, shooter power connection status