CrossTheRoadElec / Phoenix-api

CTRE Phoenix language API (targets FIRST Robotics Competition, Linux, RaspPi, Windows)
Other
39 stars 28 forks source link

pushMotionProfileTrajectory throws a null pointer exception if TrajectoryPoint.timeDur is not set #18

Closed ryegleason closed 3 years ago

ryegleason commented 6 years ago

It should probably default to 0 instead of throwing a NPE in a separate thread and causing the Talon to not execute the profile.

ozrien commented 6 years ago

Generally you should fill every member of TrajectoryPoint to ensure proper operation.

Since a null timeDir is not a sensible value, throwing is probably best. Although ideally the TrajectoryPoint constructor should fill all the values so the push routine doesn't throw if you create a new TP, and only fill the members you care about.

However, I'm not sure what timeDur should default to, the ideal default value depends on whether you are using the base trajectory duration feature or not.

Regardless you should tell the software how fast you want to run your points or you will not get the result you expected.

ozrien commented 6 years ago

Issue added to our private tracker.

JCaporuscio commented 3 years ago

This has been fixed since 5.8.0