Virtual Partner (beta code)

397 views
Skip to first unread message

Peter K

unread,
Feb 1, 2022, 1:16:38 PM2/1/22
to golden-cheetah-users

I've been working on a virtual partner concept for a while. With the assistance of Eric I wrote some code that allows the Virtual Partner (VP) functionality.  This VP can be configured to simulate 3 options.

  • Option 1 introduces an AI that can be configured to pace the user and attack every so often.  
  • Option 2 allows the user to select an ERG file to be used by the VP
  • Option 3 allows the user to select a previous activity (should be the same route that has power data) to ride against.

 

All options have been minimally tested but I'm concentrating on option 3 right now. It is recommended that the "route" attribute is added in the activity details screen. When the file is selected, the starting point, end point and total distance are checked against the selected route. A warning is displayed is either or all are different than the selected workout.

 

Here are the recommended steps to test the feature:

  • Download the executable or build your own from this branch:
  • Start GC and add your video player configuration
  • Add the "Live Map" chart to see the VP
  • Add the "Simulated Riders" chart and use the "Chart settings" to enable the VP and configure the VP engine of your choice

 

There is video posted here to show a preview of the feature. It starts by showing GC with a video player only. Then we add Live Map and Simulated Riders charts. We configure the Simulated Riders by choosing a previous ride that is different that the selected workout and it displays the warning. With the correct previous ride selected and the VP feature disabled, a message is displayed (Virtual Partner feature is disable) and nothing happens. Enabling the VP feature is not working properly because the previous ride doesn't have power information. Finally, the video shows if the correct workout, media, VideoSync and previous ride are selected, the live map chart shows the red marker and the simulated riders chart shows the distance of the VP to the user. Skipping also works.

 

It is recommended that you run GC from a command line using the debug option to see messages that need to be added to the GUI.

 

Any/all feedback is welcome.

Peter K

unread,
Feb 1, 2022, 1:18:01 PM2/1/22
to golden-cheetah-users
If anyone is interested in downloading the executable or source code plese go here.

MyJunk Junk

unread,
Feb 15, 2022, 4:38:56 AM2/15/22
to golden-cheetah-users
Looks cool!

So, basically you have the RED Dot and the BLUE dot as the 2 persons?
and then at the bottom, you have the distance in front or behind. That looks like a great implementation of chasing the rabbit (so to speak)

Peter K

unread,
Feb 15, 2022, 4:45:36 PM2/15/22
to golden-cheetah-users
That's the general idea. I wanted to start with something simple and then maybe add more rabbits. It seems to work OK for me. I was looking for any feedback if anyone is willing to try it too.

MyJunk Junk

unread,
Feb 15, 2022, 8:31:50 PM2/15/22
to golden-cheetah-users
sorry. Would love to, but I have no idea how to start compiling it from source and I don't have a windows box.

Peter K

unread,
Feb 16, 2022, 9:04:29 AM2/16/22
to golden-cheetah-users
Compiling should not be an issue. If you click on the check mark you will see the AppVeyor details and can download the artifacts. The Windows box will be an issue. I'm not sure if there are automated builds for LINUX and/or Mac

Ale Martinez

unread,
Feb 16, 2022, 10:52:25 AM2/16/22
to golden-cheetah-users
El miércoles, 16 de febrero de 2022 a la(s) 11:04:29 UTC-3, Peter K escribió:
I'm not sure if there are automated builds for LINUX and/or Mac

You need to enable Travis-ci on your fork to have Linux and Mac binaries, after reverting this commit: https://github.com/GoldenCheetah/GoldenCheetah/commit/6ecff9e2d1e055ad713cb510c42b585c491ccba8 

Peter K

unread,
Feb 16, 2022, 4:48:22 PM2/16/22
to golden-cheetah-users
Thanks Ale. A LINUX and Mac build is running now.

Peter K

unread,
Feb 17, 2022, 10:04:30 AM2/17/22
to golden-cheetah-users
Spoke too soon, no credits left for Travis builds.

Ale Martinez

unread,
Feb 17, 2022, 4:14:26 PM2/17/22
to golden-cheetah-users
El jueves, 17 de febrero de 2022 a la(s) 12:04:30 UTC-3, Peter K escribió:
Spoke too soon, no credits left for Travis builds.

Have you selected a billing plan? The free plan for open source projects gives you some credits, IIRC. 

Les McElhaney

unread,
Feb 17, 2022, 4:33:24 PM2/17/22
to golden-cheetah-users
This feature would be amazing! I use Strava Live Segments, and Garmin VTP prior to that, for my favorite routes and climbs. It is my most important road feature on my head units when out on the road. To be able to simulate this on the trainer during the Winter months would be great.

Some thoughts:
  1. I could live without the video, the dynamic map would suffice. (Maybe version 1 versus version 2 rollout?)
  2. In addition to distance ahead/behind, time ahead/behind is equally important. Chasing PRs and KOMs often comes down to mere seconds.
  3. Keeping things simple and using what exists today, I can envision the current Train screen as it exists today, plus the ability to replace the workout power profile panel with the map panel for VTP mode, and the ability to add the two metrics mentioned above in #2 as metric panels.
Simple as that, and it would be hugely useful.

Thanks or your willingness to invest your time a talent to this feature!

Best,
Les

Peter K

unread,
Feb 17, 2022, 5:05:34 PM2/17/22
to golden-cheetah-users
Yes, i picked the free plan but I thought I would get a certain amount of free credits every month. SO now i'm down to zero.

MyJunk Junk

unread,
Feb 18, 2022, 7:20:57 AM2/18/22
to golden-cheetah-users
Keeping things simple and using what exists today, I can envision the current Train screen as it exists today, plus the ability to replace the workout power profile panel with the map panel for VTP mode, and the ability to add the two metrics mentioned above in #2 as metric panels.

For this... I'm thinking if you're loading an outdoor workout and riding it as Virtual partner indoor, the speed to distance calculations would / should be different. Best would be to ride it once indoor and then use that data for virtual partner/race?

Peter K

unread,
Feb 18, 2022, 10:59:29 AM2/18/22
to golden-cheetah-users
Thank you for the feedback. Let me know if you can test the current code.

I like the video screen. I was thinking of adding the VP position on the map widget in the video and add the VP stats, so there is only one chart on the screen. Fighting to size multiple charts on the screen is not fun. However, I can see the appeal of having just the map and just add the metrics you want. It is not something i've done before but i'll take a look.

I'll have to look into adding time behind/ahead in the stats. The current code reads the power (watts) from the file and it sends it to the BicycleSim to get back position on the erg file. That code was written by someone else and changing it maybe difficult. 

As i mentioned above, this feature requires power to be present in the input file. The simplest way maybe to ride the route once in GC with virtual or trainer power. You may also be able to use the "estimated Power" tool. 

I'll try to clean up the code and maybe submit a PR. 

g.t...@voila.fr

unread,
Jan 18, 2024, 9:29:19 AM1/18/24
to golden-cheetah-users
Dear Peter,

congratulation for your program, I saw your video.
https://www.youtube.com/watch?v=ddnjEPa6qNM

I'm not a programmer, I do not know where to download your .exe program and use it with GC 3.6.
Can you please help me with the virtual partner setup.
Thank you
Best regards
Gui

Peter K

unread,
Jan 18, 2024, 10:24:51 AM1/18/24
to golden-cheetah-users
Hi Gui,

Unfortunately, the automated build has been deleted. The only way to get this to run is to compile the code. I have not had any time to work on this lately and the PR was never merged, I'm guessing due to lack of testing. 

Peter

g.t...@voila.fr

unread,
Jan 18, 2024, 11:50:41 AM1/18/24
to golden-cheetah-users
Dear Peter,

Thank you for your answer.
Best regards
Gui

Ale Martinez

unread,
Jan 20, 2024, 8:46:43 AM1/20/24
to golden-cheetah-users
El jueves, 18 de enero de 2024 a la(s) 12:24:51 p.m. UTC-3, Peter K escribió:
Hi Gui,

Unfortunately, the automated build has been deleted.

Current AppVeyor policy is to keep artifacts only for month for free accounts (https://www.appveyor.com/docs/packaging-artifacts/#artifacts-retention-policy), they need to be download and uploaded to another site if you want them be available for a longer period.
 
The only way to get this to run is to compile the code.

Just triggering a rebuild in AppVeyor should regenerate the artifacts.
 
I have not had any time to work on this lately and the PR was never merged, I'm guessing due to lack of testing. 

I took a look when created and it seemed not ready to merge, IIRC.
Currently it has conflicts with ulterior changes, resolving them would trigger an automatic rebuild. 
Reply all
Reply to author
Forward
0 new messages