Skip to content

Instantly share code, notes, and snippets.

View raghavthakar's full-sized avatar
☀️
Learning!

Raghav Thakar raghavthakar

☀️
Learning!
View GitHub Profile
# optimise the values in TPM from the X_dens
def TPMOptimisation(X_dens, task_ids):
# X_dens is the pi vector
# len(task_ids) gives the number of tasks (num_tasks)
# create the identity matrix with dimensions same as that of P (num_tasks*num_tasks)
I = []
for i in range(len(task_ids)):
temp_row = [0 for j in range(len(task_ids))]
@raghavthakar
raghavthakar / catkin_make_error.txt
Created July 22, 2022 21:48
Using ROS Action in a package from another package
#### Running command: "make -j8 -l8" in "/home/raghav/OntarioTech/AutonomousWheelchair/build"
####
[ 0%] Built target nav_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target geometry_msgs_generate_messages_cpp
[ 0%] Built target _wheelchair_control_generate_messages_check_deps_MoveDistanceActionFeedback
[ 0%] Built target _wheelchair_control_generate_messages_check_deps_MoveDistanceGoal
[ 0%] Built target sensor_msgs_generate_messages_cpp
[ 0%] Built target _wheelchair_control_generate_messages_check_deps_MoveDistanceAction
[ 0%] Built target _wheelchair_control_generate_messages_check_deps_MoveDistanceFeedback
from ortools.sat.python import cp_model
import math
# Custom library for visualisation. Can be omitted.
# from visualiser import Visualiser
NUM_AGENTS = 3
CELLS_PER_SIDE = 6
NUM_CELLS = CELLS_PER_SIDE * CELLS_PER_SIDE
INF = 5000
from ortools.sat.python import cp_model
import math
SOURCE = 1
SINK = 395
CELLS_PER_SIDE = 20
NUM_CELLS = CELLS_PER_SIDE * CELLS_PER_SIDE
INF = 10000
# Weight matrix flattened row-wise
from ortools.sat.python import cp_model
import math
# Custom library for visualisation. Can be omitted.
from visualiser import Visualiser
NUM_CELLS = 25
CELLS_PER_SIDE = int(math.sqrt(NUM_CELLS))
START_CELL = 2
TARGET_CELL = 24
@raghavthakar
raghavthakar / cp-sat.py
Created June 7, 2022 20:35
ILP Solving in CP-SAT
from ortools.sat.python import cp_model
import math
# Custom library for visualisation. Can be omitted.
from visualiser import Visualiser
NUM_CELLS = 25
CELLS_PER_SIDE = int(math.sqrt(NUM_CELLS))
START_CELL = 5
TARGET_CELL = 23