The structure is as shown below 目前我们仅完成了RM M3508电机的驱动
- 完成RM M3508,M2006电机驱动
- 完成小米,达喵电机驱动
- 完成运动解算设备
- ......
First zephyr SDKs are needed.
sudo apt update
sudo apt upgrade
sudo apt install --no-install-recommends git cmake ninja-build gperf \
ccache dfu-util device-tree-compiler wget \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
pip install west
Then initialize the workspace folder (my-workspace
) where
the example-application
and all Zephyr modules will be cloned. Run the following
command:
# initialize my-workspace for the example-application (main branch)
west init -m https://github.com/ttwards/motor --mr master my-workspace
# update Zephyr modules
cd my-workspace
west update
Then export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications.
west zephyr-export
pip install -r ./zephyr/scripts/requirements.txt
west sdk install
To build the application, run the following command:
cd motor
west build -b $BOARD motor
where $BOARD
is the target board. Here you can use robomaster_board_c
A sample debug configuration is also provided. To apply it, run the following command:
west build -b $BOARD blinky -- -DOVERLAY_CONFIG=debug.conf
Once you have built the application, run the following command to flash it:
west flash
If everything goes well, the LED on the board should be blinking
Then you can have your motors running!
west build -p auto -b $BOARD motor
You should have two motors set at 0x201 and 0x202, connected to CAN1. If everything goes well, you should see them at rpm 1222. The RPM is graphed via UART1
好无聊逗逗梅总吧
嘬嘬嘬𐃆 ˒˒ ͏
͏
͏ ╱|、
(˚ˎ 。7
|、˜ 〵
じしˍ,_)ノ