Self-Driving Camry XSE
Comma 3x video demos. openpilot can accelerate, brake automatically for other vehicles, and steer to follow the road/lane.
Comma.ai is one of the few respectable tech companies offering one of the most advanced self-driving products: the comma 3x.
- Automates ~70+% of daily driving.
- Performs exceptionally well on highways and other roads with identifiable lanes.
- Installed and mounted on a car's front windshield, so it can receive a live data feed of the road.
- Using this live feed, the comma 3x projects the path for the vehicle to follow.
Visit the website for a more comprehensive overview: comma.ai
Highway Demo (uploading soon...)
Country-ish Roads Demo (uploading soon...)
Comma API
Comma uploads driving data to its servers to train better models and improve the self-driving experience over time. We can access our driving data using the comma API. Using our driving data, we can create metrics to analyze our driving patterns and behavior. For example, I use this Python script to calculate a high-level overview of my driving metrics since installing my comma device:
from pandas import DataFrame, set_option, to_datetime
from datetime import datetime, date
from env import COMMA_AI_KEY
from authenticate import auth_comma
set_option("display.max_columns", None)
# send GET request for routes data and convert to JSON
endpoint = 'v1/devices/<insert_dongleid>/routes_segments?start=1706050612200&end=1798696800000'
resp = auth_comma(API_TOKEN=COMMA_AI_KEY, endpoint=endpoint)
json_data = resp.json()
# Create DataFrame from JSON response
df = DataFrame(json_data)
# Convert times to various formats for readability and graphing
df['end_time'] = df['end_time_utc_millis'].__truediv__(1000).astype(int)
converted_date_list = []
converted_month_list = []
for unix_time in df['end_time']:
date = datetime.fromtimestamp(unix_time).strftime('%Y-%m-%d')
month = datetime.fromtimestamp(unix_time).strftime('%Y-%m')
converted_date_list.append(date)
converted_month_list.append(month)
df['date'] = converted_date_list
df['month'] = converted_month_list
# Get date of first trip
start_date = df.sort_values('date', ascending=True)
start_date = start_date['date'].head(1).values[0]
# Reorder columns for readability
df = df[['fullname', 'create_time', 'end_time', 'date', 'month', 'start_time_utc_millis', 'end_time_utc_millis', 'start_lat', 'end_lat', 'start_lng', 'end_lng', 'length']]
# Create additional time format columns
df['time_diff_millis'] = df['end_time_utc_millis'] - df['start_time_utc_millis']
df['time_diff_seconds'] = df['time_diff_millis'].__truediv__(1000)
df['time_diff_minutes'] = df['time_diff_seconds'].__truediv__(60)
df['time_diff_hours'] = df['time_diff_minutes'].__truediv__(60)
# Filter out pseudo-trips
df = df.loc[df['length'] > 0.01]
# Export to CSV
df.to_csv("data/route_data.csv", index=False)
# Print clean format of trips
print_df = df[['date', 'length', 'time_diff_minutes']].rename(columns={
'length': 'miles',
'time_diff_minutes': 'minutes'
})
print_df['miles'] = print_df['miles'].round(2)
print_df['minutes'] = print_df['minutes'].round(2)
print('Top 15 Longest Trips:\n')
print(print_df.sort_values('miles', ascending=False).head(15))
# Perform groupby for final summary metrics
df = df.groupby(['fullname']).sum(numeric_only=True)[['length', 'time_diff_seconds', 'time_diff_minutes', 'time_diff_hours']].reset_index().sort_values('length', ascending=False)
# Calculate final summary metrics
avg_trip_length = df['length'].mean().round(2)
avg_trip_time = df['time_diff_minutes'].mean().round(2)
longest_trip_miles = df['length'].max().round(2)
longest_trip_time = df['time_diff_hours'].max().round(2)
total_trips = df['fullname'].count()
total_miles = df['length'].sum().round(2)
total_hours = df['time_diff_hours'].sum().round(2)
print("\nSummary: All Trips\n")
print('First trip: ', start_date)
today = datetime.now().strftime('%Y-%m-%d')
print('Today\'s date: ', today)
today = to_datetime(today, format="%Y/%m/%d")
start_date = to_datetime(start_date, format="%Y/%m/%d")
print('Time elapsed: ', (today - start_date).days, 'days')
print("Average trip length: ", avg_trip_length, 'miles')
print("Average trip time: ", avg_trip_time, 'minutes')
print(f'Longest trip: {longest_trip_miles} miles')
print('Longest trip: ', longest_trip_time, "hours")
print('Total trips: ', total_trips)
print('Total miles: ', total_miles)
print('Total hours: ', total_hours)
resp.close()
Output
Instead of carrying my personal Mac everywhere, I use the Pythonista app to run this script from my iPhone to retrieve updated metrics on demand. Specifically, Pythonista makes it easy for me to track work-related mileage necessary for filing an expense report for travel reimbursement.
Additionally, I use Pythonista to run another script that generates (the ugliest, most basic) line charts illustrating total miles driven by week & month. The raw numeric values are also printed in the output:
Conclusion
The end goal of this technology is to achieve full-self driving (FSD) that relies on zero human inputs to travel from point A to point B.
A high degree of uncertainty exists for when FSD will be accomplished, but it seems inevitable.
Comma is a state-of-the-art device that introduces us to self-driving's current capabilities, and grants us access to its technology + our data through its open-source philosophy.
Comma's philosophy challenges the typical behavior of corporations who are unwilling to share the data they collect.
Car manufacturers are most certainly storing the same + much more information as comma, and they are not allowing any of us access.
They are likely selling it (not anonymously, your driving data is directly linked to you) to car insurance companies or government agencies for profit.
Corporations and their data behaviors are worth identifying, but becoming an activist for this issue to inspire change seems futile.
For corporations to change their behavior, the change must further maximize shareholder value.
If not, the change will be ignored or receive the maximum resistance necessary to make it disappear.
Comma's philosophy is the best way to try and shift the culture: lead the open-source movement by example, providing opportunities to humans outside of a specific organization to improve the organization's technology.