Skip to content

Instantly share code, notes, and snippets.

View tsaoyu's full-sized avatar
🚀
Working

Tony Yu Cao tsaoyu

🚀
Working
View GitHub Profile
{
"actionButtons": {
"defaultColor": "#FFFFFF", // Can also use string color names.
"loadNpmCommands":false, // Disables automatic generation of actions for npm commands.
"reloadButton":"♻️", // Custom reload button text or icon (default ↻). null value enables automatic reload on configuration change
"commands": [
{
"cwd": "/home/yu/ORCA_control/utilities", // Terminal initial folder ${workspaceFolder} and os user home as defaults
"name": "Send to 🤖",
"singleInstance": true,
#include <iostream>
#include <memory>
class TestClass
{
private:
std::shared_ptr<int> int_shared_ptr;
public:
TestClass()
#include <ct/optcon/optcon.h>
#include "configDir.h"
#include "plotResult.h"
#include <ros/ros.h>
#include <geometry_msgs/Wrench.h>
#include <geometry_msgs/Point.h>
using namespace ct::core;
using namespace ct::optcon;
/*!
* Simple example how to linearize a system and design an LQR controller.
*
* \example LQR.cpp
*/
#include <ct/optcon/optcon.h> // also includes ct_core
void odom_callback(const nav_msgs::Odometry::ConstPtr & msg){
if (first_pass_) {
first_pass_ = false;
return ;
}
if (mpc_controller_created_) {
MPCController::create_mpc_controller();
return ;
}
void odom_callback(const nav_msgs::Odometry::ConstPtr & msg){
if (first_pass_) {
first_pass_ = false;
return ;
}
if (mpc_controller_created_) {
MPCController::create_mpc_controller();
return ;
}
def read_and_process(filename):
with open(filename, 'r') as f:
raw_content = f.readline()
raw_content = re.sub(r'conj\(([a-z0-9]+)\)', r'\1', raw_content)
raw_content = re.sub(r'cos\(', r'ct::core::tpl::TraitSelector<SCALAR>::Trait::cos(', raw_content)
raw_content = re.sub(r'sin\(', r'ct::core::tpl::TraitSelector<SCALAR>::Trait::sin(', raw_content)
raw_content = re.sub(r'([a-zA-Z0-9]+)\^2', r'\1*\1', raw_content)
raw_content = re.sub(r'abs\(([a-zA-Z0-9]+)\)', r'ct::core::tpl::TraitSelector<SCALAR>::Trait::sqrt(\1 * \1)', raw_content)
clc;
clear all;
close all;
Ts = 0.1;
EXPORT = true;
% return the time derivative of the state vector
% input the state of the vehicle and all external force
DifferentialState velocity(6) position(6);
5QFBAMM-CKC6W64-GEIL3F2-OZPSMAY-SYSIOH5-JB3EFHD-567VY5C-P4XRRAK
5QFBAMM-CKC6W64-GEIL3F2-OZPSMAY-SYSIOH5-JB3EFHD-567VY5C-P4XRRAK