Skip to content

Instantly share code, notes, and snippets.

View soulslicer's full-sized avatar

Raaj soulslicer

  • Carnegie Mellon University Robotics Institute
View GitHub Profile
@soulslicer
soulslicer / carla_car.py
Created April 19, 2021 19:21
carla_car.py
#!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# Allows controlling a vehicle with a keyboard. For a simpler and more
# documented example, please take a look at tutorial.py.
@soulslicer
soulslicer / osx_patch.txt
Created December 11, 2020 21:09
osx_patch.txt
diff --git a/cmake/Modules/FindvecLib.cmake b/cmake/Modules/FindvecLib.cmake
index 4d44e613..29ea43f7 100644
--- a/cmake/Modules/FindvecLib.cmake
+++ b/cmake/Modules/FindvecLib.cmake
@@ -18,8 +18,11 @@ find_path(vecLib_INCLUDE_DIR vecLib.h
PATHS /System/Library/Frameworks/Accelerate.framework/Versions/Current/${__veclib_include_suffix}
/System/Library/${__veclib_include_suffix}
${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
+ ${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
NO_DEFAULT_PATH)
pcl::PointXYZ lineIntersect(const std::vector<float>& P, const std::vector<float>& Q){
Eigen::Vector3f DP(P[3], P[4], P[5]);
Eigen::Vector3f DQ(Q[3], Q[4], Q[5]);
Eigen::Vector3f P0(P[0], P[1], P[2]);
Eigen::Vector3f Q0(Q[0], Q[1], Q[2]);
Eigen::Vector3f PQ = Q0 - P0;
float a = DP.dot(DP);
float b = DP.dot(DQ);
float c = DQ.dot(DQ);
static Eigen::Matrix4Xf findCameraIntersectionsOpt2(const Datum& cam_data, const std::vector<int>& good_inds, const std::vector<Point2D>& pts)
{
// Empty Matrix - Number of points of size rows
Eigen::Matrix4Xf design_pts(4, cam_data.imgw);
int valid_points = 0;
// Calculate camera ray intersections for design points
Eigen::Vector2f p0(0, 0);
// Store angles
@soulslicer
soulslicer / find_cam.cpp
Created October 15, 2019 17:13
find_cam
static Eigen::Matrix4Xf findCameraIntersectionsOpt(const Datum& cam_data, const std::vector<int>& good_inds, const std::vector<Point2D>& pts)
{
// ASK Question
// What does imgh actually refer to. Since we know the camera is rotated. Should I be using imgw
// I have changed it to imgw
// Empty Matrix - Number of points of size rows
Eigen::Matrix4Xf design_pts(4, cam_data.imgw);
int valid_points = 0;
import numpy as np
import matplotlib.patches as patches
class BSpline():
def __init__(self):
pass
self.warp = 4.
self.count = 26*2
@soulslicer
soulslicer / bspline.py
Last active February 23, 2022 14:52
B Spline Pure Numpy
import numpy as np
import matplotlib.patches as patches
class BSpline():
def __init__(self):
pass
self.warp = 4.
self.count = 26*2
@soulslicer
soulslicer / rospatch.patch
Created September 26, 2019 20:43
Patch for Ros bridge
diff --git a/carla_ros_bridge/src/carla_ros_bridge/bridge.py b/carla_ros_bridge/src/carla_ros_bridge/bridge.py
index 6a77453..0057229 100755
--- a/carla_ros_bridge/src/carla_ros_bridge/bridge.py
+++ b/carla_ros_bridge/src/carla_ros_bridge/bridge.py
@@ -367,8 +367,9 @@ class CarlaRosBridge(object):
elif carla_actor.type_id.startswith("sensor"):
if carla_actor.type_id.startswith("sensor.camera"):
if carla_actor.type_id.startswith("sensor.camera.rgb"):
+ if carla_actor.attributes["role_name"] == "noros": return None
actor = RgbCamera(
@soulslicer
soulslicer / patch.patch
Created September 25, 2019 23:47
CARLA Patch PNG
diff --git a/PythonAPI/carla/setup.py b/PythonAPI/carla/setup.py
index da5bbfb..fec897c 100755
--- a/PythonAPI/carla/setup.py
+++ b/PythonAPI/carla/setup.py
@@ -56,7 +56,7 @@ def get_libcarla_extensions():
extra_compile_args += ['-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=false']
else:
extra_link_args += ['-lpng', '-ljpeg', '-ltiff']
- extra_compile_args += ['-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=true']
+ extra_compile_args += ['-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=false']
#!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import glob
import os