Skip to content

Instantly share code, notes, and snippets.

View GBJim's full-sized avatar

Jim GBJim

  • Taiwan
View GitHub Profile
#define checkCudaErr(val) check( (val), #val, __FILE__, __LINE__)
template<typename T>
void check(T err, const char* const func, const char* const file, const int line) {
if (err != cudaSuccess) {
std::cerr << "CUDA error at: " << file << ":" << line << std::endl;
std::cerr << cudaGetErrorString(err) << " " << func << std::endl;
exit(1);
}
}
@GBJim
GBJim / argmax_example.cu
Created March 30, 2020 07:07
CUDA implementation of argmax
%%cu
#include <iostream>
#include <algorithm>
#include <cuda_runtime.h>
#include <random>
#include <chrono>
#define checkCudaErr(val) check( (val), #val, __FILE__, __LINE__)
template<typename T>
void check(T err, const char* const func, const char* const file, const int line) {
@GBJim
GBJim / argmax_example.cu
Created March 30, 2020 07:07
CUDA implementation of argmax
%%cu
#include <iostream>
#include <algorithm>
#include <cuda_runtime.h>
#include <random>
#include <chrono>
#define checkCudaErr(val) check( (val), #val, __FILE__, __LINE__)
template<typename T>
void check(T err, const char* const func, const char* const file, const int line) {
@GBJim
GBJim / trajectory_generator_waypoint.cpp
Last active November 23, 2019 10:14
trajectory_generator_waypoint.h
#include "trajectory_generator_waypoint.h"
#include <stdio.h>
#include <ros/ros.h>
#include <ros/console.h>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
using namespace Eigen;
@GBJim
GBJim / trajectory_generator_node.cpp
Created November 15, 2019 11:20
Motion Planning Chapther-5 Homework
#include <string>
#include <iostream>
#include <fstream>
#include <math.h>
#include <random>
#include <ros/ros.h>
#include <ros/console.h>
#include <nav_msgs/Path.h>
#include <nav_msgs/Odometry.h>
#include <geometry_msgs/PoseStamped.h>
@GBJim
GBJim / Astar_searcher.cpp
Last active October 17, 2019 08:19
Astar search for motion planning homework2
#include "Astar_searcher.h"
#include <stdexcept>
using namespace std;
using namespace Eigen;
void AstarPathFinder::initGridMap(double _resolution, Vector3d global_xyz_l, Vector3d global_xyz_u, int max_x_id, int max_y_id, int max_z_id)
{
gl_xl = global_xyz_l(0);
gl_yl = global_xyz_l(1);
@GBJim
GBJim / optical_flow.cpp
Last active November 17, 2018 13:09
Optical Flow in SLAM homework
#include <opencv2/opencv.hpp>
#include <string>
#include <Eigen/Core>
#include <Eigen/Dense>
using namespace std;
using namespace cv;
// this program shows how to use optical flow
@GBJim
GBJim / optical_flow.cpp
Created October 29, 2018 00:20
Only OpticalFlowSingleLevel is finished. But it's buggy ;(
#include <opencv2/opencv.hpp>
#include <string>
#include <Eigen/Core>
#include <Eigen/Dense>
using namespace std;
using namespace cv;
// this program shows how to use optical flow
@GBJim
GBJim / optical_flow.cpp
Created October 29, 2018 00:20
Only OpticalFlowSingleLevel is finished. But it's buggy ;(
#include <opencv2/opencv.hpp>
#include <string>
#include <Eigen/Core>
#include <Eigen/Dense>
using namespace std;
using namespace cv;
// this program shows how to use optical flow
@GBJim
GBJim / optical_flow.cpp
Created October 29, 2018 00:20
Only OpticalFlowSingleLevel is finished. But it's buggy ;(
#include <opencv2/opencv.hpp>
#include <string>
#include <Eigen/Core>
#include <Eigen/Dense>
using namespace std;
using namespace cv;
// this program shows how to use optical flow