File tree Expand file tree Collapse file tree 6 files changed +28
-5
lines changed
Expand file tree Collapse file tree 6 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ INCLUDES += \
2424 -I$(mkfile_path ) modules/calculators\
2525 -I$(mkfile_path ) modules/motions\
2626 -I$(mkfile_path ) modules/CameraCapture \
27- -I$(mkfile_path ) ../../raspike-athrill-v850e2m/sdk/ common/library/libcpp-spike/include \
27+ -I$(mkfile_path ) ../../common/library/libcpp-spike/include \
2828 -I/usr/include/opencv4
2929
3030APPL_LIBS += $(shell pkg-config --libs opencv4)
Original file line number Diff line number Diff line change 66
77#include " EtRobocon2025.h"
88
9+ Robot EtRobocon2025::robot; // Robotインスタンス
10+
911void EtRobocon2025::start ()
1012{
1113 std::cout << " Hello KATLAB" << std::endl;
Original file line number Diff line number Diff line change 88#define ETROBOCON2025_H
99
1010#include < iostream>
11+ #include " Robot.h"
1112
1213class EtRobocon2025 {
1314 public:
1415 static void start ();
16+
17+ private:
18+ static Robot robot; // Robotインスタンス
1519};
1620
1721#endif
Original file line number Diff line number Diff line change 66
77#include " Robot.h"
88
9- Robot::Robot () : motorController(), cameraCapture() /* , colorSensor()*/ {}
9+ Robot::Robot () : motorController(), cameraCapture() /* , colorSensor(EPort::PORT_E )*/ {}
1010
1111MotorController& Robot::getMotorControllerInstance ()
1212{
@@ -18,7 +18,7 @@ CameraCapture& Robot::getCameraCaptureInstance()
1818 return cameraCapture;
1919}
2020
21- // ColorSensor& Robot::getColorSensorInstance()
21+ // spikeapi:: ColorSensor& Robot::getColorSensorInstance()
2222// {
2323// return colorSensor;
2424// }
Original file line number Diff line number Diff line change 77#ifndef ROBOT_H
88#define ROBOT_H
99
10+ #include " spikeapi.h"
1011#include " MotorController.h"
1112#include " CameraCapture.h"
1213// #include "ColorSensor.h"
@@ -31,10 +32,16 @@ class Robot {
3132 */
3233 CameraCapture& getCameraCaptureInstance ();
3334
35+ // /**
36+ // * @brief ColorSensorのインスタンスの参照を返す
37+ // * @return メンバ変数colorSensor(ColorSensorのインスタンス)の参照
38+ // */
39+ // spikeapi::ColorSensor& getColorSensorInstance();
40+
3441 private:
3542 MotorController motorController; // MotorControllerインスタンス
3643 CameraCapture cameraCapture; // CameraCaptureインスタンス
37- // ColorSensor colorSensor; // ColorSensorインスタンス
44+ // spikeapi:: ColorSensor colorSensor; // ColorSensorインスタンス
3845};
3946
4047#endif
Original file line number Diff line number Diff line change @@ -29,4 +29,14 @@ namespace etrobocon2025_test {
2929 EXPECT_EQ (&cameraRef1, &cameraRef2);
3030 }
3131
32- } // namespace etrobocon2025_test
32+ // ゲッターで取得したColorSensorインスタンスが等しいか確認するテスト
33+ // TEST(RobotTest, GetColorSensorInstanceReturnsReference)
34+ // {
35+ // Robot robot;
36+ // spikeapi::ColorSensor& colorSensorRef1 = robot.getCameraCaptureInstance();
37+ // spikeapi::ColoeSensor& colorSensorRef2 = robot.getCameraCaptureInstance();
38+
39+ // EXPECT_EQ(&cameraRef1, &cameraRef2);
40+ // }
41+
42+ } // namespace etrobocon2025_test
You can’t perform that action at this time.
0 commit comments