Skip to content
This repository was archived by the owner on Sep 13, 2025. It is now read-only.

Commit 70acd90

Browse files
author
Marlin
committed
Updates from pool test
1 parent 7d24747 commit 70acd90

File tree

7 files changed

+11
-6
lines changed

7 files changed

+11
-6
lines changed

src/sub_mission/src/commands.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ float align(vision::Perception &per, ros::ServiceClient &client, int attempts)
1010
{
1111
client.call(per);
1212
printResponse(per);
13-
14-
average += atmega::state().axis[YAW] + per.response.hangle;
13+
if (per.response.prob > 0.5)
14+
average += atmega::state().axis[YAW] + per.response.hangle;
1515
}
1616

1717
average /= attempts;
@@ -20,6 +20,7 @@ float align(vision::Perception &per, ros::ServiceClient &client, int attempts)
2020

2121
void move(const State &dest)
2222
{
23+
atmega::write(dest);
2324
bool quit = false;
2425
while (!quit)
2526
{

src/sub_mission/src/mission.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ int main(int argc, char** argv)
2626
else
2727
start = true;
2828
}
29+
atmega::write("p 0.2\n");
2930

3031
// Run mission functions.
3132
gate(perception, client);

src/sub_mission/src/prelim.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ int main(int argc, char** argv)
1818
bool start = false;
1919
while (!start && !SIM)
2020
{
21+
ROS_INFO("Waiting to start PRELIM.");
2122
if (!atmega::alive())
2223
ros::Duration(0.5).sleep();
2324
else
2425
start = true;
2526
}
27+
atmega::write("p 0.2\n");
2628

2729
// Run mission functions.
28-
move(State(8, -2, 0, 0, 0, 0));
29-
move(State(8, 2, 0, 0, 0, 0));
30-
move(State(4, 0, 0, 0, 0, 0));
30+
move(State(3, -1, 0, 0, 0, 0));
31+
move(State(3, 1, 0, 0, 0, 0));
32+
move(State(1, 0, 0, 0, 0, 0));
3133
move(State(-1, 0, 0, 0, 0, 0));
3234
}

src/sub_vision/src/acquisition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int acquireImages(CameraPtr pCam, INodeMap & nodeMap, INodeMap & nodeMapTLDevice
6868
exposureMode->SetIntValue(exposureMode->GetEntryByName("Timed")->GetValue());
6969

7070
Spinnaker::GenApi::CFloatPtr exposureTime = pCam->GetNodeMap().GetNode("ExposureTime");
71-
exposureTime->SetValue(1300);
71+
exposureTime->SetValue(1305);
7272

7373
// Retrieve integer value from entry node
7474
int64_t acquisitionModeContinuous = ptrAcquisitionModeContinuous->GetValue();

src/sub_vision/src/mock_camera.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ int main(int argc, char** argv)
2020
while (node.ok())
2121
{
2222
ROS_INFO("Published image.");
23+
ros::Duration(0.5).sleep();
2324
pub.publish(msg);
2425
ros::spinOnce();
2526
}

test_image.png

-14.9 MB
Loading

test_image_2.png

-33.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)