File tree Expand file tree Collapse file tree 5 files changed +72
-0
lines changed Expand file tree Collapse file tree 5 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 4242 mkdir artifacts
4343 cp ./out/openmower-yardforce.bin ./artifacts
4444 cp ./out/openmower-yardforce.elf ./artifacts
45+ cp ./out/openmower-yardforce-v4.bin ./artifacts
46+ cp ./out/openmower-yardforce-v4.elf ./artifacts
4547 cp ./out/openmower-worx.bin ./artifacts
4648 cp ./out/openmower-worx.elf ./artifacts
4749 cp ./out/openmower-lyfco-e1600.bin ./artifacts
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ COPY . /project
2222WORKDIR /project
2323RUN mkdir build
2424RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=YardForce -BYardForce && cd YardForce && make -j$(nproc)
25+ RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=YardForce_V4 -BYardForce_V4 && cd YardForce_V4 && make -j$(nproc)
2526RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=Worx -BWorx && cd Worx && make -j$(nproc)
2627RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=Lyfco_E1600 -BLyfco_E1600 && cd Lyfco_E1600 && make -j$(nproc)
2728RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=Sabo -BSabo && cd Sabo && make -j$(nproc)
@@ -39,6 +40,9 @@ COPY --from=builder /project/build/flash-info.html /flash-info.html
3940COPY --from=builder /project/build/YardForce/openmower.bin /openmower-yardforce.bin
4041COPY --from=builder /project/build/YardForce/openmower.elf /openmower-yardforce.elf
4142
43+ COPY --from=builder /project/build/YardForce_V4/openmower.bin /openmower-yardforce-v4.bin
44+ COPY --from=builder /project/build/YardForce_V4/openmower.elf /openmower-yardforce-v4.elf
45+
4246COPY --from=builder /project/build/Worx/openmower.bin /openmower-worx.bin
4347COPY --from=builder /project/build/Worx/openmower.elf /openmower-worx.elf
4448
Original file line number Diff line number Diff line change 1+ #ifndef YARDFORCE_V4_ROBOT_HPP
2+ #define YARDFORCE_V4_ROBOT_HPP
3+
4+ #include < drivers/charger/bq_2576/bq_2576.hpp>
5+
6+ #include " robot.hpp"
7+
8+ class YardForce_V4Robot : public MowerRobot {
9+ public:
10+ void InitPlatform () override ;
11+ bool IsHardwareSupported () override ;
12+
13+ UARTDriver* GPS_GetUartPort () override {
14+ #ifndef STM32_UART_USE_USART6
15+ #error STM32_SERIAL_USE_UART6 must be enabled for the YardForce build to work
16+ #endif
17+ return &UARTD6;
18+ }
19+
20+ float Power_GetDefaultBatteryFullVoltage () override {
21+ return 7 .0f * 4 .2f ;
22+ }
23+
24+ float Power_GetDefaultBatteryEmptyVoltage () override {
25+ return 7 .0f * 3 .3f ;
26+ }
27+
28+ float Power_GetDefaultChargeCurrent () override {
29+ return 0.5 ;
30+ }
31+
32+ float Power_GetAbsoluteMinVoltage () override {
33+ // 3.3V min, 7s pack
34+ return 7 .0f * 3.0 ;
35+ }
36+
37+ private:
38+ BQ2576 charger_{};
39+ };
40+
41+ #endif // YARDFORCE_V4_ROBOT_HPP
Original file line number Diff line number Diff line change 77#include " ../include/worx_robot.hpp"
88#include " ../include/xbot_robot.hpp"
99#include " ../include/yardforce_robot.hpp"
10+ #include " ../include/yardforce_v4_robot.hpp"
1011
1112#define EXPAND (x ) x
1213#define ROBOT_CLASS_NAME (platform ) platform##Robot
Original file line number Diff line number Diff line change 1+ #include " ../include/yardforce_v4_robot.hpp"
2+
3+ #include < services.hpp>
4+
5+ void YardForce_V4Robot::InitPlatform () {
6+ InitMotors ();
7+ charger_.setI2C (&I2CD1);
8+ power_service.SetDriver (&charger_);
9+ }
10+
11+ bool YardForce_V4Robot::IsHardwareSupported () {
12+ // Accept YardForce 1.x.x boards
13+ if (strncmp (" hw-openmower-yardforce" , carrier_board_info.board_id , sizeof (carrier_board_info.board_id )) == 0 &&
14+ carrier_board_info.version_major == 1 ) {
15+ return true ;
16+ }
17+
18+ // Accept early testing boards
19+ if (strncmp (" hw-xbot-devkit" , carrier_board_info.board_id , sizeof (carrier_board_info.board_id )) == 0 ) {
20+ return true ;
21+ }
22+
23+ return false ;
24+ }
You can’t perform that action at this time.
0 commit comments