OpenField Cloud API

Sergey Sandler

2022-01-27

http://catapultr.catapultsports.com - the catapultR package home.

library(catapultR)

Types of data accessible with catapultR from the cloud by consuming OpenField APIs,

An access token, an athlete ID and an activity or period ID are the required parameters to the above APIs,

10 Hz sensor data example

if (suppressMessages(require("DT")))
{
    x <- suppressMessages(readr::read_csv(of10HzDataFileCSV()))
    DT::datatable(x) %>% DT::formatRound('x', 3) %>% DT::formatRound('y', 3)
}

IMA events

Available IMA events:

cat(paste('- ', ima_events()), sep='\n')

The set of available events is controlled by available sport plugins. The modules allocated to a user account control the plugins that are available. Modules are allocated by Catapult support staff.

The IMA events are generated by:

Accessing IMA events stored in the cloud

token <- ofCloudGetToken("APAC", "sergey", "password", "clientID", "clientSecret")
to <- as.integer(Sys.time()); from <- to - 7*24*60*60
activities <- ofCloudGetActivities(token, to = to, from = from)
athletes <- ofCloudGetAthletesInActivity(token, activities$id[1])
events <- ofCloudGetActivityEvents(token, athletes$id[1], activities$id[1], c("ima_acceleration", "ima_impact"))
eventsAcceleration <- events[["ima_acceleration"]]
eventsImpact <- events[["ima_impact"]]

IMA events example: rugby_union_scrum event

if (suppressMessages(require("DT")))
{
    x <- suppressMessages(readr::read_csv(ofIMAFileCSV()))
    DT::datatable(x)
}

Velocity efforts example

if (suppressMessages(require("DT")))
{
    x <- suppressMessages(readr::read_csv(ofVelEffortsFileCSV()))
    DT::datatable(x)
}