Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
src/initFunction.hpp@1:2594a70c1ddd, 2021-05-26 (annotated)
- Committer:
 - _seminahn
 - Date:
 - Wed May 26 05:26:16 2021 +0000
 - Revision:
 - 1:2594a70c1ddd
 - Parent:
 - 0:4ff8aeb3e4d1
 - Child:
 - 2:0de4854743f7
 
sonar num 11 -> 10
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| _seminahn | 0:4ff8aeb3e4d1 | 1 | #ifndef ZETA_STM_KINETIC_INITFUNCTION_H_ | 
| _seminahn | 0:4ff8aeb3e4d1 | 2 | #define ZETA_STM_KINETIC_INITFUNCTION_H_ | 
| _seminahn | 0:4ff8aeb3e4d1 | 3 | #include "mbed.h" | 
| _seminahn | 0:4ff8aeb3e4d1 | 4 | #include "threadDeclaration.hpp" | 
| _seminahn | 0:4ff8aeb3e4d1 | 5 | #include "instanceHeader.hpp" | 
| _seminahn | 0:4ff8aeb3e4d1 | 6 | #include "rosHeader.hpp" | 
| _seminahn | 0:4ff8aeb3e4d1 | 7 | |
| _seminahn | 0:4ff8aeb3e4d1 | 8 | void initThread() { | 
| _seminahn | 0:4ff8aeb3e4d1 | 9 | gThread[0].start(IMU_thread); | 
| _seminahn | 0:4ff8aeb3e4d1 | 10 | gThread[1].start(bt_thread); | 
| _seminahn | 0:4ff8aeb3e4d1 | 11 | gThread[2].start(sonar_thread); | 
| _seminahn | 1:2594a70c1ddd | 12 | #ifdef NO_ROS | 
| _seminahn | 0:4ff8aeb3e4d1 | 13 | gThread[3].start(print_thread); | 
| _seminahn | 0:4ff8aeb3e4d1 | 14 | #else | 
| _seminahn | 1:2594a70c1ddd | 15 | //gThread[3].start(module_thread); | 
| _seminahn | 1:2594a70c1ddd | 16 | gThread[3].start(imu_pub_thread); | 
| _seminahn | 1:2594a70c1ddd | 17 | gThread[4].start(sonar_pub_thread); | 
| _seminahn | 1:2594a70c1ddd | 18 | gThread[5].start(estop_pub_thread); | 
| _seminahn | 0:4ff8aeb3e4d1 | 19 | gThread[7].start(bt_pub_thread); | 
| _seminahn | 0:4ff8aeb3e4d1 | 20 | #endif | 
| _seminahn | 1:2594a70c1ddd | 21 | //gThread[8].start(test_thread); | 
| _seminahn | 0:4ff8aeb3e4d1 | 22 | } | 
| _seminahn | 0:4ff8aeb3e4d1 | 23 | |
| _seminahn | 0:4ff8aeb3e4d1 | 24 | void initBT() { | 
| _seminahn | 0:4ff8aeb3e4d1 | 25 | bt.baud(9600); | 
| _seminahn | 0:4ff8aeb3e4d1 | 26 | bt_data.rec = '\0'; | 
| _seminahn | 0:4ff8aeb3e4d1 | 27 | bt_data.sen = '\0'; | 
| _seminahn | 0:4ff8aeb3e4d1 | 28 | } | 
| _seminahn | 0:4ff8aeb3e4d1 | 29 | |
| _seminahn | 1:2594a70c1ddd | 30 | #ifdef NO_ROS | 
| _seminahn | 0:4ff8aeb3e4d1 | 31 | void initSerial() { | 
| _seminahn | 0:4ff8aeb3e4d1 | 32 | pc.baud(115200); | 
| _seminahn | 0:4ff8aeb3e4d1 | 33 | } | 
| _seminahn | 0:4ff8aeb3e4d1 | 34 | #else | 
| _seminahn | 0:4ff8aeb3e4d1 | 35 | void initROS() { | 
| _seminahn | 0:4ff8aeb3e4d1 | 36 | nh.getHardware()->setBaud(460800); | 
| _seminahn | 0:4ff8aeb3e4d1 | 37 | nh.initNode(); | 
| _seminahn | 0:4ff8aeb3e4d1 | 38 | nh.advertise(IMU_publisher); | 
| _seminahn | 0:4ff8aeb3e4d1 | 39 | nh.advertise(EStop_publisher); | 
| _seminahn | 0:4ff8aeb3e4d1 | 40 | nh.advertise(Bumper_publisher); | 
| _seminahn | 0:4ff8aeb3e4d1 | 41 | nh.advertise(US_publisher); | 
| _seminahn | 0:4ff8aeb3e4d1 | 42 | nh.advertise(Bluetooth_publisher); | 
| _seminahn | 1:2594a70c1ddd | 43 | //nh.subscribe(ModuleControl_subscriber); | 
| _seminahn | 1:2594a70c1ddd | 44 | //nh.subscribe(UVCcontrol_subscriber); | 
| _seminahn | 0:4ff8aeb3e4d1 | 45 | nh.subscribe(Bluetooth_subscriber); | 
| _seminahn | 1:2594a70c1ddd | 46 | //UVCcontrolMsg.data = false; | 
| _seminahn | 0:4ff8aeb3e4d1 | 47 | while(!nh.connected()) nh.spinOnce(); | 
| _seminahn | 0:4ff8aeb3e4d1 | 48 | waitTmr.start(); | 
| _seminahn | 0:4ff8aeb3e4d1 | 49 | nh.loginfo("zeta module and sonar controller is initialized!!!"); | 
| _seminahn | 0:4ff8aeb3e4d1 | 50 | nh.loginfo("=================================================="); | 
| _seminahn | 0:4ff8aeb3e4d1 | 51 | } | 
| _seminahn | 0:4ff8aeb3e4d1 | 52 | #endif | 
| _seminahn | 0:4ff8aeb3e4d1 | 53 | |
| _seminahn | 0:4ff8aeb3e4d1 | 54 | #endif |