![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
carbase
Dependencies: mbed mbed-rtos ros_lib_melodic
Diff: main.cpp
- Revision:
- 7:fe1f52d848fd
- Parent:
- 6:66de1f4abff4
- Child:
- 8:e542adce95e9
diff -r 66de1f4abff4 -r fe1f52d848fd main.cpp --- a/main.cpp Wed Feb 17 09:46:01 2021 +0000 +++ b/main.cpp Thu Feb 18 09:58:58 2021 +0000 @@ -18,6 +18,9 @@ DigitalOut Refer_Volt_3_3 = PB_1; DigitalOut motor_enable = PC_7; DigitalOut motor_stop[] = {PB_6, PC_5, PC_0}; + +geometry_msgs::Twist wheel_data; + // -> Motor PWN Pin PwmOut motor_pwm[] = {PA_9, PC_8, PA_11}; //motor number @@ -100,14 +103,22 @@ motorStop(i); } +void Callback(const geometry_msgs::Twist& _msg) { + + +} + ros::Subscriber<std_msgs::Float32MultiArray> subax("moving_base", &baseCallback); ros::Subscriber<std_msgs::Float32MultiArray> subbt("fcn_button", &messageCb); ros::Subscriber<geometry_msgs::Twist> subtw("base_twist", &twCallback); int main() { + //ros::Rate rate(10); nh.getHardware()->setBaud(BAUD); nh.initNode(); // nh.subscribe(subax); nh.subscribe(subbt); + nh.subscribe(subtw); + motor_init(); while (1) { nh.spinOnce();