You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
toDirection Method of MapLocation is Non-static #260
The toDirection Method which takes a Map Location in as a parameter is a non static method so it cannot be used in our Robots as they use static methods. If we use a non - static run method then it may not work in the competition. Please add the static keyword to the method.
Hi @protrooper, thanks for the message! We believe it wouldn't make sense to make the directionTo method static, as it depends on the actual MapLocation object you're querying. To be precise, we would expect you to be calling someLocation.directionTo(someOtherLocation), rather than MapLocation.directionTo(someOtherLocation).
If you are hoping to find the direction to a location from your current location, then you should instead start by retrieving your current location, and using rc.getLocation().directionTo(someOtherLocation).
Activity
j-mao commentedon Jan 11, 2021
Hi @protrooper, thanks for the message! We believe it wouldn't make sense to make the
directionTomethod static, as it depends on the actualMapLocationobject you're querying. To be precise, we would expect you to be callingsomeLocation.directionTo(someOtherLocation), rather thanMapLocation.directionTo(someOtherLocation).If you are hoping to find the direction to a location from your current location, then you should instead start by retrieving your current location, and using
rc.getLocation().directionTo(someOtherLocation).Please let us know if this resolves your issue!