{"action":"created","issue":{"url":"https://api.github.com/repos/Courseplay/courseplay/issues/2897","repository_url":"https://api.github.com/repos/Courseplay/courseplay","labels_url":"https://api.github.com/repos/Courseplay/courseplay/issues/2897/labels{/name}","comments_url":"https://api.github.com/repos/Courseplay/courseplay/issues/2897/comments","events_url":"https://api.github.com/repos/Courseplay/courseplay/issues/2897/events","html_url":"https://github.com/Courseplay/courseplay/issues/2897","id":372571528,"node_id":"MDU6SXNzdWUzNzI1NzE1Mjg=","number":2897,"title":"Crossings fixed","user":{"login":"Nila24","id":13526129,"node_id":"MDQ6VXNlcjEzNTI2MTI5","avatar_url":"https://avatars1.githubusercontent.com/u/13526129?v=4","gravatar_id":"","url":"https://api.github.com/users/Nila24","html_url":"https://github.com/Nila24","followers_url":"https://api.github.com/users/Nila24/followers","following_url":"https://api.github.com/users/Nila24/following{/other_user}","gists_url":"https://api.github.com/users/Nila24/gists{/gist_id}","starred_url":"https://api.github.com/users/Nila24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nila24/subscriptions","organizations_url":"https://api.github.com/users/Nila24/orgs","repos_url":"https://api.github.com/users/Nila24/repos","events_url":"https://api.github.com/users/Nila24/events{/privacy}","received_events_url":"https://api.github.com/users/Nila24/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-22T15:33:39Z","updated_at":"2018-10-23T15:05:50Z","closed_at":"2018-10-22T16:23:42Z","author_association":"NONE","body":"Hi\r\n\r\nI fixed course merge and load for myself and find it extremely useful - maybe it would be useful for anybody else as well. Sorry for the format - do not beat me too hard - it is first time I post anything on Github. \r\n\r\nAll changes are in course_management.lua file courseplay:loadCourse procedure, but I do use new function angledif - included just above loadCourse. \r\n\r\nFirst change I would call regular. No longer the closest crossing points are used. Instead two courses are merged depending on the crossing points pair that results in lowest total direction angle change. So in 4 way intersection you would put 8 crossing points total (for both directions) and merging will pick and use correct pair. As in original - only pairs within 50m of each other are considered. Do you no longer need to make 8+ additional courses at intersections and micromanage these files. \r\n\r\nDo keep in mind that any other cross points that are within 50m may also be picked so either reduce the range to 30m or so or just do not place lots of extra cross points before intersection.\r\n\r\nSecond part at the end of procedure is something of a hack for now, but it still works much better for me than the original. In a nutshell all recorded speeds are replaced by current vehicle road speed - so you can actually record with tractor and have pickup drive the course much faster. \r\n\r\nIn itself it would be as useful as the \"max speed\" drive option (i.e. not at all) since your transport would fall over at every turn. So the entire course (all way points) filtering is applied. Basically if there is a change in direction between any two points more than 2 degrees then 4 preceding point speed is de-rated to 90% of their current value, If more than 5 degree - another 80% on top of that. On long curves multiple deratements take place, so the actual speed turns out pretty decent and normally nothing tips over. Obviously you can tinker (in the script) with actual values for angles and number of deratement points.   \r\n\r\nMore than 30 degree turns (including those intersections above) are handled differently in that it will gradually (over 6 points) slow the vehicle from whatever speed was at that point down to \"turn\"speed. You can adjust turn speed value before loading course to have it faster or slower than default. \r\n\r\nObviously can improve that further by taking actual vehicle mass (if available?) and turn radius into account, but that stuff _really_ do not belong in course_management.lua file, does it?     \r\n\r\n[course_management.zip](https://github.com/Courseplay/courseplay/files/2501886/course_management.zip)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Courseplay/courseplay/issues/comments/432285793","html_url":"https://github.com/Courseplay/courseplay/issues/2897#issuecomment-432285793","issue_url":"https://api.github.com/repos/Courseplay/courseplay/issues/2897","id":432285793,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjI4NTc5Mw==","user":{"login":"pvajko","id":2379521,"node_id":"MDQ6VXNlcjIzNzk1MjE=","avatar_url":"https://avatars3.githubusercontent.com/u/2379521?v=4","gravatar_id":"","url":"https://api.github.com/users/pvajko","html_url":"https://github.com/pvajko","followers_url":"https://api.github.com/users/pvajko/followers","following_url":"https://api.github.com/users/pvajko/following{/other_user}","gists_url":"https://api.github.com/users/pvajko/gists{/gist_id}","starred_url":"https://api.github.com/users/pvajko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvajko/subscriptions","organizations_url":"https://api.github.com/users/pvajko/orgs","repos_url":"https://api.github.com/users/pvajko/repos","events_url":"https://api.github.com/users/pvajko/events{/privacy}","received_events_url":"https://api.github.com/users/pvajko/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T15:05:50Z","updated_at":"2018-10-23T15:05:50Z","author_association":"NONE","body":"@Nila24 thanks, you may also want to take a look at this old pull request: https://github.com/Courseplay/courseplay/pull/1259 which has never been accepted for unknown reasons.\r\n\r\nWe have an ongoing refactoring/code cleaning effort also impacting drive.lua so at this point I would not change anything in that area until we are done with that.\r\n\r\nI tried to use radians consistently  in the course generator part to avoid converting back and forth all the time."}}
{"actor":{"display_login":"pvajko"}}