Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mechanism2d field not published to network table with smartdashboard #7868

Open
isaacngkh opened this issue Mar 19, 2025 · 8 comments
Open
Labels
type: bug Something isn't working.

Comments

@isaacngkh
Copy link

isaacngkh commented Mar 19, 2025

Describe the bug
We notice that we cannot see our mechanism2d in ascope. It seems the .controllable/.name/.type and many other fields are empty after updating to 2025.3.2. In simulation, this works as expected. Only in log files.

To Reproduce
Steps to reproduce the behavior:

  1. Publish mechanism2d with SmartDashboard.putData()
  2. try to drag it into Poses in ascope in 3d field
  • Link to code:

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Left is a log from today with 2025.3.2. RIght is a log from saturday with 2025.3.1
Image

Desktop (please complete the following information):

  • OS: windows 11
  • Project Information: [In Visual Studio Code, press the WPILib button and choose WPILib: Open Project Information. Press the copy button and paste the data here. If not using VS Code, please include WPILib version, Gradle version, Java version, C++ version (if applicable), and any third party libraries and versions]

WPILib Information:
Project Version: 2025.3.2
VS Code Version: 1.96.2
WPILib Extension Version: 2025.3.2
C++ Extension Version: 1.23.2
Java Extension Version: 1.38.0
Java Debug Extension Version: 0.58.1
Java Dependencies Extension Version 0.24.1
Java Version: 17
Java Location: C:\Users\Public\wpilib\2025\jdk
Vendor Libraries:
DogLog (2025.4.0)
PathplannerLib (2025.2.6)
CTRE-Phoenix (v6) (25.3.1)
photonlib (v2025.2.1)
PlayingWithFusion (2025.01.23)
REVLib (2025.0.3)
WPILib-New-Commands (1.0.0)

Additional context
Add any other context about the problem here.

@isaacngkh isaacngkh added the type: bug Something isn't working. label Mar 19, 2025
@Gold856
Copy link
Contributor

Gold856 commented Mar 19, 2025

Unable to reproduce with a log from 2025.2.1. Are you sure that you a) let the data load in and b) actually are viewing the log at a timestamp where the Mechanism2d has been published? I can reproduce your issue if I scrub the log to a point before the Mechanism2d was published.
Image

@isaacngkh
Copy link
Author

It's a problem we started seeing after updating to 2025.3.2 yesterday. We've not seen this problem before with older version of WPILib. Here is a log file from yesterday after updating 2025.3.2

It is not just this one log file with this problem; it is every log file since updating 2025.3.2. We are using DogLog, so maybe it has something to do with DogLog instead of WPILib. Here is our code where we are publishing the Mechanism2d to SmartDashboard, and we log NT into log files with DogLog

@Gold856
Copy link
Contributor

Gold856 commented Mar 19, 2025

I examined the log using https://github.com/wpilibsuite/allwpilib/blob/main/wpiutil/examples/printlog/datalog.py and can confirm that the data for several of the other topics is missing. I haven't been able to root cause it though, and there's no changes to WPILib since 2025.3.1 that would affect that part of the code. It is possible you're seeing a weird interaction/race condition and 2025.3.2 just happened to trigger it. If you have time, could you start DogLog before RobotContainer is constructed? I'm curious to see if that will properly capture the data.

@isaacngkh
Copy link
Author

Interesting. Moved doglog before robot container initialization and it's working now. Thanks!

@isaacngkh
Copy link
Author

Now I am noticing that the meta data we are logging ourselves are missing from the log file, in additional to SystemStats that DogLog log for us. A log file from today. After moving dog log before robot container, and mechanism2d is properly showing up

@Gold856
Copy link
Contributor

Gold856 commented Mar 20, 2025

Yeah, it sounds like you hit some sort of race condition where you started NT capture just after a bunch of data gets published and so the log misses that data and somehow 2025.3.2 triggered it. It's a little bit weird that data that gets published periodically seems to also be missing, but as long as it all gets resolved by turning on NT logging first, you're probably fine.

@PeterJohnson
Copy link
Member

Sounds like a bug in DogLog? It should properly handle this case (starting it after some stuff has already been written to NT).

@tssmith7
Copy link

I'm having the same problem and I don't use DogLog. I will try to put together a test case but at this point it seems to work in Live Mode (NT) and the logs created using simulation but not the logs created on the RoboRio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

4 participants