Skip to content

Instantly share code, notes, and snippets.

AFRAME.registerComponent('pressable', {
schema: {
pressDistance: {
default: 0.06
}
},
init: function() {
this.worldPosition = new THREE.Vector3();
this.handEls = document.querySelectorAll('[hand-tracking-controls]');
AFRAME.registerComponent('camera-logger', {
schema: {
timestamp: {
type: 'int'
},
seconds: {
type: 'int'
}
},
init: function() {
@addy1997
addy1997 / github_desktop_ubuntu.sh
Last active June 29, 2022 18:25 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
sudo wget https://github.com/shiftkey/desktop/releases/download/release-2.9.3-linux3/GitHubDesktop-linux-2.9.3-linux3.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-2.9.3-linux3.deb
# UPDATE (2021-03-05): Thanks to PaoloRanzi81's comment, the updated code is as follows https://gist.github.com/PaoloRanzi81
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 5 00:24:39 2021
@author: adwaitnaik
"""
import pandas as pd
import numpy as np

Hi, I am Adwait, an Electronics engineer by profession with a knack for learning to program intelligent machines. A roboticist by choice and guitarist in leisure time, I like to learn new languages(I already can speak 7) and do speed cubing when I am not punching keys on my computer. Previously, I worked at HTIC, IIT-Madras with the Spine Robotics team on an amazing project based on Image Guided Surgery (IGS) for the UR5 robotic arm. Previous to that, I was a summer fellow at CVIT, IIIT-H. In my sophomore year, I worked as robotics intern at KUKA, India along with the team of few engineers from ISRO on developing motion planning algorithms for robotic arms. Currently, I am waiting to join my master's at University of Bristol in Robotics.

def get_agent_states(self):
start_state = None
target_state = None
start_state = list(map(lambda x:x[0] if len(x) > 0 else None, np.where(insert_grid_map==4)))
target_state = list(map(lambda x:x[0] if len(x) > 0 else None, np.where(insert_grid_map==3)))
if (start_state == [None, None] or target_state == [None, None]):
sys.exit('Start or Target state not specified')
#fetching agent states
def get_agent_states(self):
start_state = None
target_state = None
start_state = list(map(lambda x:x[0] if len(x) > 0 else None, np.where(insert_grid_map==4)))
target_state = list(map(lambda x:x[0] if len(x) > 0 else None, np.where(insert_grid_map==3)))
#constructing grid and fetching observations
#reading the data from the grid
def read_grid_map(self, insert_grid_map):
with open(insert_grid_map, 'r') as f:
grid_map = f.readlines()
grids = np.array(list(map(lambda x:
list(map(lambda y: int(y),
x.split(''))), grid_map)))
#next step
def step(self, action):
action = self.actions
reward_dict = {'up':10, 'down':10, 'left':10, 'right':10, 'begin':0, 'obstacle':-5}
next_state = (self.agent_state[0]+self.actions_pos_dict[actions][0],
self.agent_state[1]+self.actions_pos_dict[actions][1] )
#creating Grid Environment
COLORS = {0:[0.0,0.0,0.0], 1:[0.5,0.5,0.5],
2:[0.0,0.0,1.0], 3:[0.0,1.0,0.0],
4:[1.0,0.0,0.0], 6:[1.0,0.0,1.0],
7:[1.0,1.0,0.0]}
class GridEnv(gym.Env):