Skip to content

Instantly share code, notes, and snippets.

View KevinLADLee's full-sized avatar
🎃
Focusing

ChengYang Li KevinLADLee

🎃
Focusing
  • HKU and HiveMatrix
  • Hong Kong
View GitHub Profile
#include <vector>
#include <iostream>
std::vector<int> crossArray(std::vector<int> num1, std::vector<int> num2){
int i1 = 0;
int i2 = 0;
std::vector<int> result;
while(i1 < num1.size() &&
i2 < num1.size())
{
#!/usr/bin/env python
#
# Copyright (c) 2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
import numpy as np
import carla
@KevinLADLee
KevinLADLee / carla_map_viz.py
Created August 19, 2021 09:38
carla_map_viz.py
#!/usr/bin/env python
#
# Copyright (c) 2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
handle a opendrive sensor
"""
template <typename T>
std::vector<T> ReadObjectVectorFromBinary(const std::string & file_path) {
std::ifstream FILE(file_path, std::ios::in | std::ios::binary );
std::streampos begin,end;
begin = FILE.tellg();
FILE.seekg(0,std::ios::end);
end = FILE.tellg();
std::cout << "size is: " << (end-begin) << " bytes.\n";
unsigned long size = end-begin;
cmake_minimum_required(VERSION 3.5.1)
project(carla_cppclient)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++14")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g")
find_package(Threads REQUIRED)
find_package(JPEG REQUIRED)
find_package(TIFF REQUIRED)
@KevinLADLee
KevinLADLee / carla_waypoint_publisher.py
Created December 30, 2020 14:29
for carla 0.9.10.1, delete unnecessary waypoints
#!/usr/bin/env python
#
# Copyright (c) 2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Generates a plan of waypoints to follow
It uses the current pose of the ego vehicle as starting point. If the
#!/usr/bin/env python
import glob
import os
import sys
import carla
import argparse
import logging
###RAW_DATA_CITY_BEGIN###
https://s3.eu-central-1.amazonaws.com/avg-kitti/devkit_raw_data.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0001/2011_09_26_drive_0001_extract.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0001/2011_09_26_drive_0001_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_calib.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0001/2011_09_26_drive_0001_tracklets.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0002/2011_09_26_drive_0002_extract.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0002/2011_09_26_drive_0002_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0002/2011_09_26_drive_0002_tracklets.zip
@KevinLADLee
KevinLADLee / kitti_archives.txt
Created March 20, 2020 07:19
Kitti Archives
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_dagm_2013_illumination_changes.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_dagm_2013_large_displacements.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_depth_annotated.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_depth_selection.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_depth_velodyne.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_calib.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_det_2.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_image_2.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_image_3.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_label_2.zip
@KevinLADLee
KevinLADLee / execute_command_get_output.cpp
Created August 6, 2019 15:50
run an arbitrary command and get its output
#include <cstdio>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <string>
#include <array>
std::string exec(const char* cmd) {
std::array<char, 128> buffer;
std::string result;