Skip to content

Mission summary logger - #544

Open
atorrell24 wants to merge 7 commits into
mainfrom
mission-summary-logger
Open

Mission summary logger#544
atorrell24 wants to merge 7 commits into
mainfrom
mission-summary-logger

Conversation

@atorrell24

Copy link
Copy Markdown

Opening this early for direction and code feedback per our chat, not merge-ready yet.

Addresses #471. The mission planner currently uses BT.CPP's StdCoutLogger, which prints every status transition, and since the tree ticks ~30x/s the terminal fills with repeated lines. This starts on the Format C summary we landed on.

What's here so far is MissionSummaryLogger, a header-only logger that subclasses StatusChangeLogger. It records each node's result and run duration, keyed by node UID so the repeated RelativeMove legs don't overwrite each other, and prints a per-node summary from its destructor so it fires on any exit path including Ctrl-C. It's a logger rather than a mission operation, so no factory registration or CMake changes are needed.

Current state: the class is written and I'm wiring it into mission_planner_node.cpp next to the existing loggers for a first SquareTestMission run.

Direction from here in the comment below, would appreciate your notes on it.

The imu-socat alias created a /dev/ttyV0 pseudo-terminal that tunneled the navtube Pi's IMU serial stream over TCP so the vectornav node could run on the Jetson. joe_shmore.py existed only to babysit that fake port, flushing its buffers when nothing held it open.

Per #455, vectornav will run directly on the Pi and read the IMU's real local serial device, publishing over ROS 2 topics (DDS handles the cross-machine transport). That makes both the socat tunnel and its keepalive obsolete, so this removes them.

Still pending: the serial port in the vectornav submodule config (/dev/ttyV0 -> real device path) is not changed yet, since it needs the actual device path from the Pi and a decision on where that override should live.
@atorrell24
atorrell24 requested a review from Carlosdc25 July 23, 2026 16:19
@atorrell24 atorrell24 self-assigned this Jul 23, 2026
@atorrell24

Copy link
Copy Markdown
Author

Hey Carlos, here's the plan from here so you can drop notes on any of it before I go further.

Wire the logger into the node and do a first SquareTestMission run to confirm the output matches reality (keeping StdCoutLogger on temporarily to cross-check, then silencing it).
Handle nodes that finish without ever going RUNNING, like the AtGoalPose condition, which right now produce blank rows.
Format the output into a proper aligned table like the Format C mockup, result plus duration per operation.
Add the ticks column using per-node tick counters, since the status-change callback alone can't count ticks.
Write the summary to a file so we keep mission history.

Groot2 is already wired in the node so that stays available alongside the text summary, matching what you said about running both. Let me know if you'd reorder any of this or want the table to look different, and I'll adjust before building it out.

@Carlosdc25

Copy link
Copy Markdown
Contributor

Hi Anthony your plan sounds good. I think you're going about implementing this the right way

A few notes:

  • Make sure to pull from main, looking at the file diffs I can see your branch is out dated somewhat
  • When you test the new logging try to paste images of that in here

@atorrell24

Copy link
Copy Markdown
Author

Okay great, thank you so much man!

@atorrell24

Copy link
Copy Markdown
Author

Hey Carlos! Here is a snippet of what the logs look like now!
Screenshot from 2026-07-27 21-58-29

I still have the old log code running so you can see the side by side comparison but I will be commenting it out on my local branch until you get back to me on this update!

@Carlosdc25

Copy link
Copy Markdown
Contributor

Can you add the summary files to subjugtaor/mission_planner/logs(new folder)

And print the original logs during mission runs

@atorrell24

Copy link
Copy Markdown
Author

Hey Carlos, just finished what you asked for but I had a question to see what you wanted to do. First, would you want me to add this summary files to the .gitignore so that they don't get committed? If so, which section would it be? (I am assuming I make my own little section called logs or something like that). Secondly, the way the folder and pathing is creating is hard coded and local, if you think it is better to make it so its not just local?

@wingdeans wingdeans left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting might be easier with std::format, but what you have now also works.

  1. Change this line to the entire folder

    mil2/.gitignore

    Line 195 in 79da1b1

    src/subjugator/mission_planner/logs/mission_debug.txt
  2. Yes, maybe in ~/mil2/src/subjugator/mission_planner/logs

void callback(BT::Duration timestamp, const BT::TreeNode& node, BT::NodeStatus prev_status,
BT::NodeStatus status) override
{
if (status == BT::NodeStatus::RUNNING)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid running every tick, could we use prev_status == IDLE? Haven't verified if this works

std::cout << table.str();
std::time_t now = std::time(nullptr);
char fname[128];
std::filesystem::create_directories("src/subjugator/mission_planner/logs");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't necessarily run mission planner in a fixed working directory. Maybe base it off ~/mil2?

@atorrell24

Copy link
Copy Markdown
Author

Tested the prev_status == IDLE change, it works well. The retry nodes now report their full duration from first start instead of resetting on each retry, so RetryUntilSuccessful lines up exactly with its parent RelativeMove and Timeout per leg, which is the behavior we wanted. All nodes still show up, nothing got dropped. Screenshot of a clean SquareTestMission run attached!! I also updated the .gitignore and the pathing.

@atorrell24

Copy link
Copy Markdown
Author
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants