Code Monkey home page Code Monkey logo

roborts-firmware's Introduction

概述

软件环境

  • Toolchain/IDE : MDK-ARM V5 / arm-none-eabi
  • package version: STM32Cube FW_F4 V1.24.0
  • FreeRTOS version: 10.0.0
  • CMSIS-RTOS version: 1.02

编程规范

  • 变量和函数命名方式遵循 Unix/Linux 风格
  • chassis_task与gimbal_task是强实时控制任务,优先级最高,禁止被其他任务抢占或者阻塞
  • 不需要精确计时的任务,采用自行实现的软件定时器实现,定时精度受任务调度影响

注意事项

1.由于发射机构触动开关阻力非常小,轻微转动拨弹电机就可能造成子弹越过触动开关触碰摩擦轮,导致摩擦轮摩擦过大无法启动,造成摩擦轮磨损和电机启动失败。因此,开电前务必检查是否有子弹已经越过触动开关。取出办法:用手按住一侧摩擦轮,旋转另一个摩擦轮。

2.由于snail电机初始化未成功时,电机产生叫声的频率在角速度响应范围内,会极大的干扰云台控制,导致无法正常控制。解决方法:可以对陀螺仪数据采用带阻滤波解决。(本版本未加入)

3.在云台控制逻辑中,考虑到调试视觉识别装甲时可能需要发射子弹功能,所以自动模式下开放了单发功能。但如果在单发后没有将左拨杆回中,会导致在从自动模式下切回手动模式立刻触发连发模式。因此,在自动模式下单发之后务必保证将拨杆拨回中间位置。

4.国际开发板C型上有一枚跳线帽,用于区分当前为底盘模块还是云台模块,插上跳线帽为底盘模块。出现不能控制且无声光报警请检查跳线帽是否松动,

兼容2019年车体结构

打开 appcfg.h 文件的宏 ICRA2019 可以使用2019年车体结构参数,包括轮距轴距,云台轴向等。

云台校准方法

国际开发板C型自带用户按键,短按可以进行陀螺仪校准。云台模块完成陀螺仪校准后,还会利用机械限位进行云台角度校准

触发条件:

1.开发板首次刷入程序或者参数区被清空

2.按下板载白色按键触发

注意:校准时务必将底盘放在水平地面,保证车体静止

模块离线说明

当车辆的某个模块离线时,可以根据声光指示进行问题定位

蜂鸣器鸣叫次数按照离线模块的优先级进行错误指示,例如云台电机优先级高于拨弹电机,如果同时发生离线,先指示当前离线设备是云台电机

注意:有且仅有在遥控器右上摇杆拨到下方,同时底盘C型板接入到机载电脑并运行相关驱动后,才能屏蔽电机模块离线功能

模块离线对应的状态如下,数字对应蜂鸣器每次鸣叫的次数,按照优先级排序:

底盘模块

  1. 右前轮电机掉线
  2. 左前轮电机掉线
  3. 左后轮电机掉线
  4. 右后轮电机掉线

云台模块

  1. 云台 YAW 电机掉线
  2. 云台 PITCH 电机掉线
  3. 拨盘电机掉线

遥控器离线

此时红灯常亮,所有执行器失效

妙算心跳离线

当右上角拨杆开关打下时,若没有收到妙算心跳,此时蓝灯常亮

文档

快速开始

硬件接口

主控板使用国际开发板 C 型,各个功能接口的位置如下:

云台接口 17: pwm pin 18: trigger pin

底盘接口 19: firmware config pin.

功能模块

手动模式:

提供遥控器基础控制。

全自动模式:

这种模式下底盘、云台、发射机构受到上层 PC 的完全控制,完全控制包含对这些执行机构以具体物理单位的控制。

操作档位说明:

手动档

遥控器控制(底盘跟随云台):右拨杆上 遥控器控制(云台跟随地盘):右拨杆中

  • 开、关摩擦轮(左拨杆上拨)
  • 单发、连发射击(左拨杆下拨)
自动档

正常比赛时使用(拨杆右下)

左拨杆位置对应功能:

  • 上:摩擦轮打开,其他全接管
  • 中:摩擦轮关闭,其他全接管
  • 下:只具有单发功能

程序说明

程序体系结构

体系框架

  1. 使用免费及开源的 freertos 操作系统,兼容其他开源协议 license;
  2. 使用标准 CMSIS-RTOS 接口,方便不同操作系统或平台间程序移植;
  3. 提供一套抽象步兵机器人bsp,简化上层逻辑;

application:上层应用任务,包括系统任务

bsp:C型开发板适配包

components:通用机器人模块,包括命令行,驱动模块和系统组件

doc:说明文档

MDK-ARM:armcc工具链,注意:未购买license最多只能编译20kb大小固件

tools: cmake gnu toolchain. You should install make, cmake, arm-none-eabi and set env value.

软件体系

固件提供统一的机器人软件栈,所有业务逻辑包含在application中,使用观察者模式分发信息,软件框架如下:

硬件体系

  1. 主控 MCU:STM32F407IGHx,配置运行频率180MHz
  2. 模块通信方式:CAN;CAN设备:电机电调、陀螺仪模块
  3. 上下层通信方式:USB虚拟串口
  4. 麦轮安装方式:O型

协议数据

数据分类

协议数据按照通信方向可以分为两大类:

底层发送给上层的数据:

  1. 反馈信息:包含各个机构传感器反馈信息、底层计算出来的一些反馈信息;
  2. 底层状态信息:包含底层设备运行状态、底层对上层数据的一些响应等;
  3. 转发数据:包含裁判系统的全部信息、服务器端的自定义信息;

底层接收的上层数据:

  1. 控制信息:上层对底层 3 个执行机构的控制信息;

roborts-firmware's People

Contributors

bzrobotics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

roborts-firmware's Issues

How to control the motor by remote?

Sorry to raise such seemingly stupid question. However, we have read the code from freertos.c, remote_ctrl.c to chassis_task.c, we still couldn't find the way to control the motor by remote. And we also find code in chassis_task.c never runs, which obsesses me a lot. Still waiting for help...

The Shoot Control Problem

Hello. I met a problem during my development.
I want to control the shooting device use api porvide by RoboRTS
there some difference between RoboRTS and RoboRTS-Firmware on the fric_wheel_spd
in RoboRTS. range is 1-100
in RoboRTS-Firmware,range is 1000-2000
when i set fric_wheel_spd = 1, is ok the wheel run well, but when i set "fric_wheel_spd" more then one , the wheel did not run, is there a shoot control sample or is there some wrong with the RoboRTS-Firmware

old version board && new version Firmware

hello, @KevinLADLee @robomasterbot ,I bought the infantry car in 2018.1 which used the old version board,but the RoboRTS-Firmware is based on the new type board(Type A). I have compared the schematics,there were some differences between them ,the main different was the IMU,can new firmware work in old version board? Do you have the firmware based on old version board?

请问单轴陀螺仪是哪款呢,

载入程序后板子响了8声,陀螺仪离线,但是连接上萝马集市的九轴陀螺仪后还是会响。是因为陀螺仪不对吗?

Request for opening an ioc file

The organizing committee is requested to officially open the iCMP configuration file of the STM32-CubeMX of the project. It is easy for developers to upgrade and improve themselves.

robomasterC型开发板刷固件的问题

robomasterC型开发板的型号是407,而Firmware中给的程序型号是427,当device中芯片型号改成407后会报错,请问怎么解决?初此参赛,请多指教
报错截图
修改芯片型号

Can the source code be used to drive the car directly?

I have trid to drive the car with RoboRTS-Firmware,but I failed anyway.now,I have recovered the macro definition of “#define AUTO_NAVIGATION” in sys_config.h ,and I found in function "can_msg_send_task" ,"send_chassis_motor_ctrl_message(glb_cur.chassis_cur)" has been executed successed when the value of glb_cur.chassis_cur are not zero and can be changed by remote control , but four mecanum wheels just won't move.I have checked several documents about this,but I didn't found any solution,is there anything I need to do or something maybe I forgot?
I know it might be a stupid question,but I really don't know what to do now,any suggestion would be appreciated,thanks in advanced.

Porblems about gimbal calibration

Hello there. This is a really nice code. However, I met a issue about gimbal calibration. I followed the
four steps in 'Gimbal calibration method' which was mentioned in the 'readme.txt' , first , I turned the remote control levers to gimbal disabled position and infantry powered on , and I ran the program , the codes ran into the function called 'no_cali_data_handle()', then goes into the gimbal_cali_msg_hook() , but it never goes into' if ((last_type == GIMBAL_CALI_START) && (cur_type == GIMBAL_CALI_END))' branches. How can I set up these two types? And I cannot find a variable called cali_param.Gimbal.cali_cmd, just found cali_param_data.cali_cmd , and I set it to 1, It returned nothing , and every variables were 0xFF. So I cannot calibration my gimbal motors correctly. By the way , I uses 6623 motors as gimbal motors. I'm looking forward for your reply. Thanks.

The Gimbal Problem

Hello. I met a problem during my development. I calibrated two motors of the gimbal, and they made a success initial and both of them back to the center. However, the motors will become dramatic shaking after about five minutes power off, at this moment if we restart the power quickly, the gimbal will back to normal and we can take a good control of it. Is this a bug or just we made any mistake. Some other teams said they met the same problem when we communicate with each other. Looking forward for your reply. Thanks.

The data of yaw of imu is always changing bigger or smaller

Hello. I met a problem during my development. I saw the data of imu, and I found that the data of yaw of imu is always changing bigger. But the data of pitch and rol is stable. I wonder did other team met this problem either. Is this a bug or just we made any mistake. Looking forward for your reply. Thanks.

the code it stop in port.c line 311

I used the A type board and old car ,but the car can't move,I debug the code it stop in port.c line 311(svc 0),if I use the A type board with the old car,are there anywhere need to change in the code?

云台电机错误

当我把程序下进去后,开始提示云台电机(Y或P轴电机)离线,当我用其他程序时,云台电机是能正常工作的,说明云台通信良好,请问想这是什么原因?感谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.