.. default-domain:: java .. highlight:: java .. package:: krpc.client.services.MechJeb RoverAutopilot ============== .. type:: public class RoverAutopilot The Rover Autopilot window, which drives a rover at a heading and speed, or along its waypoints. .. method:: boolean getControlHeading() .. method:: void setControlHeading(boolean value) Whether the autopilot holds :meth:`RoverAutopilot.getHeading()`. :Game Scenes: Flight .. method:: double getHeading() .. method:: void setHeading(double value) The heading to hold, in degrees. :Game Scenes: Flight .. note:: Requires :meth:`RoverAutopilot.getControlHeading()`. .. method:: double getHeadingError() The difference between the vessel's heading and the heading to hold, in degrees. :Game Scenes: Flight .. method:: boolean getControlSpeed() .. method:: void setControlSpeed(boolean value) Whether the autopilot holds :meth:`RoverAutopilot.getSpeed()`. :Game Scenes: Flight .. method:: double getSpeed() .. method:: void setSpeed(double value) The speed to hold, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. note:: Requires :meth:`RoverAutopilot.getControlSpeed()`. .. method:: double getSpeedError() The difference between the vessel's speed and the speed to hold, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. method:: double getTargetSpeed() The speed the autopilot drives at now, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. method:: boolean getStabilityControl() .. method:: void setStabilityControl(boolean value) Whether the autopilot keeps the rover upright. :Game Scenes: Flight .. method:: boolean getBrakeOnEject() .. method:: void setBrakeOnEject(boolean value) Whether to brake when the crew leaves the rover. :Game Scenes: Flight .. method:: boolean getBrakeOnEnergyDepletion() .. method:: void setBrakeOnEnergyDepletion(boolean value) Whether to brake when the rover runs out of electric charge. :Game Scenes: Flight .. method:: boolean getWarpToDaylight() .. method:: void setWarpToDaylight(boolean value) Whether to warp time to daylight after braking for a lack of electric charge. :Game Scenes: Flight .. note:: Requires :meth:`RoverAutopilot.getBrakeOnEnergyDepletion()`. .. method:: java.util.List getWaypoints() The waypoints, in the order the rover drives to them. :Game Scenes: Flight .. method:: int getWaypointIndex() The index of the waypoint the autopilot drives to, or -1 if there is none. :Game Scenes: Flight .. method:: boolean getLoopWaypoints() .. method:: void setLoopWaypoints(boolean value) Whether to return to the first waypoint after the last one. :Game Scenes: Flight .. method:: RoverWaypoint addWaypoint(double latitude, double longitude) Add a waypoint at a position on the surface of the body the vessel is at. :param double latitude: The latitude, in degrees. :param double longitude: The longitude, in degrees. :returns: The waypoint. :Game Scenes: Flight .. method:: void clearWaypoints() Remove all the waypoints. :Game Scenes: Flight .. method:: RoverWaypoint addTarget() Add a waypoint at the target. Throws an exception if the target is not a vessel or a position on the surface. :returns: The waypoint. :Game Scenes: Flight .. method:: void driveToTarget() Replace the waypoints with the target, and drive to it. Throws an exception if the target is not a vessel or a position on the surface. :Game Scenes: Flight .. method:: void drive() Drive along the waypoints. Throws an exception if there are none. :Game Scenes: Flight .. method:: void stop() Stop driving along the waypoints. :Game Scenes: Flight RoverWaypoint ------------- .. type:: public class RoverWaypoint A waypoint of the :type:`RoverAutopilot`, as the Waypoints window shows it. .. note:: The object is destroyed once the waypoints are cleared or replaced, as by :meth:`RoverAutopilot.clearWaypoints()` and :meth:`RoverAutopilot.driveToTarget()`. .. method:: double getLatitude() .. method:: void setLatitude(double value) The latitude of the waypoint, in degrees. Throws an exception when set if the waypoint is at a vessel. :Game Scenes: Flight .. method:: double getLongitude() .. method:: void setLongitude(double value) The longitude of the waypoint, in degrees. Throws an exception when set if the waypoint is at a vessel. :Game Scenes: Flight .. method:: float getRadius() .. method:: void setRadius(float value) The distance from the waypoint at which the rover has reached it, in meters. :Game Scenes: Flight .. method:: String getName() .. method:: void setName(String value) The name of the waypoint. :Game Scenes: Flight .. method:: float getMinSpeed() .. method:: void setMinSpeed(float value) The lowest speed on the way to the waypoint, in :math:`\mathrm{m/s}`, or 0 for no limit. :Game Scenes: Flight .. method:: float getMaxSpeed() .. method:: void setMaxSpeed(float value) The highest speed on the way to the waypoint, in :math:`\mathrm{m/s}`, or 0 for no limit. :Game Scenes: Flight