Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

CP Speed Setting Conversion & other Speed setting issues #6041

Closed
pops64 opened this issue Sep 8, 2020 · 4 comments
Closed

CP Speed Setting Conversion & other Speed setting issues #6041

pops64 opened this issue Sep 8, 2020 · 4 comments
Assignees

Comments

@pops64
Copy link
Contributor

pops64 commented Sep 8, 2020

So the text of the unit says CP is converting from KPH to MPH. But the values are still represented as KPH. 12 KPH is ~ 6 MPH this tractor is currently reversing. Also theses settings are no longer representing the value that they should be. I adjusted turn speed on headlands and it went faster. I was using turn for headland setting but it was on a straight after turning.

FS 17 Courseplay speeds
Field Speed was any non turn segment of a generated course and Mode 2 when not on the user course. FS 19 seems to be the turn speed

Turn Speed was any generated turn when traveling in the forward direction. FS19 doesn't seem to do anything

Reversing Speed still seems to work as it did in 17.

Street Speed. Was only ever used for user recorded courses. FS19 it seems to represent field speed and the max shouldn't be set at 6kph it was set at the max KPH of the tractor

Would be nice to see theses values resorted as the current way of displaying them makes it anyone's guess at which value to adjust to make your tractor go faster or slower depending on how CP is handling driving the tractor.

fsScreen_2020_09_07_23_39_43

@Tensuko Tensuko added the bug label Sep 8, 2020
@pops64 pops64 changed the title CP no longer converts settings from KPH to MPH CP Speed Setting Conversion & other Speed setting issues Sep 8, 2020
@VergylTantor
Copy link

Also reported as Issue #5994

@pops64
Copy link
Contributor Author

pops64 commented Sep 9, 2020

Sorry been out the loop. Just breaking into what has been changed in FS19 CP but it looks like what handles driving only has one speed setting that would apply to this when driving the course(Not Turning or Unloading). Maybe there should be added if statements depending on the mode that is calling AI Driver or how ever the CP code is handled

courseplay/AIDriver.lua

Lines 406 to 449 in e28884e

function AIDriver:driveCourse(dt)
self:updateLights()
-- check if reversing
local lx, lz, moveForwards, isReverseActive = self:getReverseDrivingDirection()
-- stop for fuel if needed
if not self:checkFuel() then
self:hold()
end
if not self:getIsEngineReady() then
if self:getSpeed() > 0 and self.allowedToDrive then
self:startEngineIfNeeded()
self:hold()
self:debugSparse('Wait for the engine to start')
end
end
-- use the recorded speed by default
if not self:hasTipTrigger() then
self:setSpeed(self:getRecordedSpeed())
end
local isInTrigger, isAugerWagonTrigger = self.triggerHandler:isInTrigger()
if self:getIsInFilltrigger() or isInTrigger then
self:setSpeed(self.vehicle.cp.speeds.approach)
if isAugerWagonTrigger then
self:setSpeed(self.APPROACH_AUGER_TRIGGER_SPEED)
end
end
self:slowDownForWaitPoints()
self:stopEngineIfNotNeeded()
if isReverseActive then
-- we go wherever goReverse() told us to go
self:driveVehicleInDirection(dt, self.allowedToDrive, moveForwards, lx, lz, self:getSpeed())
elseif self.useDirection then
lx, lz = self.ppc:getGoalPointDirection()
self:debug('%.1f %.1f', lx, lz)
self:driveVehicleInDirection(dt, self.allowedToDrive, moveForwards, lx / 2, lz, self:getSpeed())
else
-- use the PPC goal point when forward driving or reversing without trailer
local gx, _, gz = self.ppc:getGoalPointLocalPosition()
self:driveVehicleToLocalPosition(dt, self.allowedToDrive, moveForwards, gx, gz, self:getSpeed())
end
end

@pops64
Copy link
Contributor Author

pops64 commented Sep 9, 2020

Sorry for the double post. As for the conversion issue. I went through past releases of CP 6 and 5 and I am pretty sure this is the code that did it for us. We let Giants do the conversion through the g_i18n:getSpeed function not sure if this still available in 19 or if you still want to do it this way. Just putting it out there

courseplay/hud.lua

Lines 831 to 852 in b720cca

elseif entry.functionToCall == 'changeTurnSpeed' then
vehicle.cp.hud.content.pages[page][line][1].text = courseplay:loc('COURSEPLAY_SPEED_TURN');
vehicle.cp.hud.content.pages[page][line][2].text = string.format('%d %s', g_i18n:getSpeed(vehicle.cp.speeds.turn), courseplay:getSpeedMeasuringUnit());
elseif entry.functionToCall == 'changeFieldSpeed' then
vehicle.cp.hud.content.pages[page][line][1].text = courseplay:loc('COURSEPLAY_SPEED_FIELD');
vehicle.cp.hud.content.pages[page][line][2].text = string.format('%d %s', g_i18n:getSpeed(vehicle.cp.speeds.field), courseplay:getSpeedMeasuringUnit());
elseif entry.functionToCall == 'changeReverseSpeed' then
vehicle.cp.hud.content.pages[page][line][1].text = courseplay:loc('COURSEPLAY_SPEED_REVERSING');
vehicle.cp.hud.content.pages[page][line][2].text = string.format('%d %s', g_i18n:getSpeed(vehicle.cp.speeds.reverse), courseplay:getSpeedMeasuringUnit());
elseif entry.functionToCall == 'changeMaxSpeed' then
local streetSpeedStr = ('%d %s'):format(g_i18n:getSpeed(vehicle.cp.speeds.street), courseplay:getSpeedMeasuringUnit());
if vehicle.cp.speeds.useRecordingSpeed then
vehicle.cp.hud.content.pages[page][line][1].text = courseplay:loc('COURSEPLAY_SPEED_MAX');
vehicle.cp.hud.content.pages[page][line][2].text = courseplay:loc('COURSEPLAY_MAX_SPEED_MODE_AUTOMATIC'):format(streetSpeedStr);
else
vehicle.cp.hud.content.pages[page][line][1].text = courseplay:loc('COURSEPLAY_SPEED_MAX');
vehicle.cp.hud.content.pages[page][line][2].text = streetSpeedStr
end

@Tensuko Tensuko added enhancement and removed bug labels Jan 16, 2021
schwiti6190 added a commit that referenced this issue May 12, 2021
- fixes div. cruise control speed #3727
- fixes hud speed display in mph #6041
- should fix f1 menu refresh after open/close hud action event #7143
- fixes beacon lights mode 1 #6197
schwiti6190 added a commit that referenced this issue May 12, 2021
- fixes div. cruise control speed #3727
- fixes hud speed display in mph #6041
- should fix f1 menu refresh after open/close hud action event #7143
- fixes beacon lights mode 1 #6197
pvaiko pushed a commit that referenced this issue May 12, 2021
- fixes div. cruise control speed #3727
- fixes hud speed display in mph #6041
- should fix f1 menu refresh after open/close hud action event #7143
- fixes beacon lights mode 1 #6197
@Tensuko
Copy link
Contributor

Tensuko commented May 13, 2021

fixed with 6.03.00060

@Tensuko Tensuko closed this as completed May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants