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.
Dependencies: mbed ros_lib_kinetic
Diff: main.cpp
- Revision:
- 2:0537a8007a39
- Parent:
- 1:1ac7d472cfa2
- Child:
- 4:89ebfa37663b
diff -r 1ac7d472cfa2 -r 0537a8007a39 main.cpp --- a/main.cpp Tue Feb 06 20:50:55 2018 +0000 +++ b/main.cpp Thu Feb 08 22:23:40 2018 +0000 @@ -25,18 +25,12 @@ DigitalOut LED(PA_5); PwmOut liftSpeed(D10); // Normally D10 DigitalOut liftDirection(D11); -//DigitalIn hallSensor1(D9); -//DigitalIn hallSensor2(D12); DigitalIn button(USER_BUTTON); Ticker hallInt; -Ticker dynaInt; -Ticker imuInt; -Ticker rosInt; -Ticker liftInt; Timer filter_hall1; -BNO055 IMU(D14, D15); DynamixelClass gimbal(57600, D7, D8, D2); + ros::NodeHandle nh; ros::Subscriber<std_msgs::Float32MultiArray> sub("module_command", &module_commandCB); @@ -44,22 +38,19 @@ // Variables struct fields control; struct fields rosInput; -bool liftFlag = 0; -bool motorFlag = 0; -bool homeFlag = 0; -bool imuFlag = 0; -bool rosFlag = 0; volatile int currentPosition = 0; int prevPosition = 0; bool stall = false; + // Main Program int main() { // Initializations - filter_hall1.start(); //Start Filtering Timer - setupGimbal(); + filter_hall1.start(); //Start Filtering Timer + setupGimbal(); // Gimbal setupLift(); // Lift setupROSNode(nh, sub); // ROS Node Handle + // Main Loop while (1) { // Lift Operation @@ -68,6 +59,6 @@ runGimbal(); //ROS Functions nh.spinOnce(); - rosCheck(); + rosCheck(); } }