repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/easy_markers/src/easy_markers/generator.py
people/wu_ros_tools/easy_markers/src/easy_markers/generator.py
import roslib; roslib.load_manifest('easy_markers') import tf import rospy from visualization_msgs.msg import Marker, MarkerArray from geometry_msgs.msg import Point, Quaternion def get_point(position, scale=1.0): pt = Point() if position is None: pt.x = 0.0 pt.y = 0.0 pt.z = 0.0 el...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/easy_markers/src/easy_markers/interactive.py
people/wu_ros_tools/easy_markers/src/easy_markers/interactive.py
import roslib; roslib.load_manifest('easy_markers') from easy_markers.generator import MarkerGenerator from interactive_markers.interactive_marker_server import * from interactive_markers.menu_handler import * from visualization_msgs.msg import InteractiveMarkerControl TYPEDATA = { 'rotate_x': [1,1,0,0, Interacti...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/easy_markers/src/easy_markers/__init__.py
people/wu_ros_tools/easy_markers/src/easy_markers/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/kalman_filter/setup.py
people/wu_ros_tools/kalman_filter/setup.py
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup package_info = generate_distutils_setup( packages=['kalman_filter'], package_dir={'': 'src'}, ) setup(**package_info)
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/wu_ros_tools/kalman_filter/src/kalman_filter/__init__.py
people/wu_ros_tools/kalman_filter/src/kalman_filter/__init__.py
#!/usr/bin/python class Kalman: def __init__(self, Q=.002, R=1.0, P=.01): self.x = None self.Q = Q self.R = R self.P = P self.p = None def update(self, values): N = len(values) if self.x is None: self.x = values self.p = [self.P]*N else: for i in range(N): self.p[i] += self.Q k = se...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/people_velocity_tracker/scripts/tracker.py
people/people_velocity_tracker/scripts/tracker.py
#!/usr/bin/python import roslib; roslib.load_manifest('people_velocity_tracker') import rospy import tf import math from geometry_msgs.msg import Point, Vector3 from geometry_msgs.msg import Twist, TwistWithCovariance from people_msgs.msg import PositionMeasurementArray, Person, People from easy_markers.generator impor...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/people_velocity_tracker/scripts/static.py
people/people_velocity_tracker/scripts/static.py
#!/usr/bin/python import roslib; roslib.load_manifest('people_velocity_tracker') import rospy import sys from people_msgs.msg import Person, People class VelocityTracker(object): def __init__(self): self.ppub = rospy.Publisher('/people', People, queue_size=10) def spin(self): rate = rospy.Ra...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/people/face_detector/scripts/face_detector_action_client.py
people/face_detector/scripts/face_detector_action_client.py
#! /usr/bin/env python import roslib; roslib.load_manifest('face_detector') import rospy # Brings in the SimpleActionClient import actionlib # Brings in the messages used by the face_detector action, including the # goal message and the result message. import face_detector.msg def face_detector_client(): # Crea...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/laser_filters/test/fake_laser.py
laser_filters/test/fake_laser.py
#!/usr/bin/python PKG = 'laser_filters' # this package name import roslib; roslib.load_manifest(PKG) import rospy from sensor_msgs.msg import LaserScan from Numeric import ones def laser_test(): pub = rospy.Publisher('laser_scan', LaserScan) rospy.init_node('laser_test') laser_msg = LaserScan() lase...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/Python-RVO2/setup.py
Python-RVO2/setup.py
from setuptools import setup, Extension from setuptools.command.build_ext import build_ext as _build_ext from Cython.Build import cythonize class BuildRvo2Ext(_build_ext): """Builds RVO2 before our module.""" def run(self): # Build RVO2 import os import os.path import subproce...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/Python-RVO2/example.py
Python-RVO2/example.py
#!/usr/bin/env python import rvo2 sim = rvo2.PyRVOSimulator(1/60., 1.5, 5, 1.5, 2, 0.4, 2) # Pass either just the position (the other parameters then use # the default values passed to the PyRVOSimulator constructor), # or pass all available parameters. a0 = sim.addAgent((0, 0)) a1 = sim.addAgent((1, 0)) a2 = sim.ad...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/navigation/base_local_planner/setup.py
navigation/base_local_planner/setup.py
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages = ['local_planner_limits'], package_dir = {'': 'src'}, ) setup(**d)
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/navigation/base_local_planner/src/local_planner_limits/__init__.py
navigation/base_local_planner/src/local_planner_limits/__init__.py
# Generic set of parameters to use with base local planners # To use: # # from local_planner_limits import add_generic_localplanner_params # gen = ParameterGenerator() # add_generic_localplanner_params(gen) # ... # # Using these standard parameters instead of your own allows easier switching of local planners # ne...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/navigation/amcl/test/basic_localization.py
navigation/amcl/test/basic_localization.py
#!/usr/bin/env python import sys import time from math import fmod, pi import unittest import rospy import rostest from tf2_msgs.msg import TFMessage import PyKDL from std_srvs.srv import Empty class TestBasicLocalization(unittest.TestCase): def setUp(self): self.tf = None self.target_x = None ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/navigation/amcl/test/set_pose.py
navigation/amcl/test/set_pose.py
#!/usr/bin/env python import rospy import math import PyKDL from geometry_msgs.msg import PoseWithCovarianceStamped class PoseSetter(rospy.SubscribeListener): def __init__(self, pose, stamp, publish_time): self.pose = pose self.stamp = stamp self.publish_time = publish_time def peer...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/navigation/map_server/test/consumer.py
navigation/map_server/test/consumer.py
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/navigation/fake_localization/static_odom_broadcaster.py
navigation/fake_localization/static_odom_broadcaster.py
#!/usr/bin/python # # Similar to static_transform_broadcaster, this node constantly publishes # static odometry information (Odometry msg and tf). This can be used # with fake_localization to evaluate planning algorithms without running # an actual robot with odometry or localization # # Author: Armin Hornung # Licens...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/turtlebot_apps/turtlebot_calibration/src/turtlebot_calibration/scan_to_angle.py
turtlebot_apps/turtlebot_calibration/src/turtlebot_calibration/scan_to_angle.py
#! /usr/bin/python #*********************************************************** # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/turtlebot_apps/turtlebot_calibration/src/turtlebot_calibration/calibrate.py
turtlebot_apps/turtlebot_calibration/src/turtlebot_calibration/calibrate.py
#! /usr/bin/python #*********************************************************** # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/turtlebot_apps/turtlebot_actions/scripts/test_move.py
turtlebot_apps/turtlebot_actions/scripts/test_move.py
#!/usr/bin/env python import roslib roslib.load_manifest('turtlebot_actions') import rospy import os import sys import time import math from turtlebot_actions.msg import * from actionlib_msgs.msg import * import actionlib ''' Very simple move action test - commands the robot to turn 45 degrees and travel 0.5 met...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/turtlebot_apps/turtlebot_actions/scripts/test_fiducial.py
turtlebot_apps/turtlebot_actions/scripts/test_fiducial.py
#!/usr/bin/env python import roslib roslib.load_manifest('turtlebot_actions') import rospy import os import sys import time from turtlebot_actions.msg import * from actionlib_msgs.msg import * import actionlib def main(): rospy.init_node("find_fiducial_pose_test") # Construct action ac rospy.loginfo("Star...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/turtlebot_apps/turtlebot_follower/scripts/switch.py
turtlebot_apps/turtlebot_follower/scripts/switch.py
#!/usr/bin/env python # license removed for brevity import rospy from geometry_msgs.msg import Twist from sensor_msgs.msg import Joy # This script will listen for joystick button 5 being toggled and # send zero speed messages to the mux to disable the follower until # button 5 is pressed again. class BehaviorSwitch(o...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/scripts/sarl_original_node.py
sarl_star_ros/scripts/sarl_original_node.py
#!/usr/bin/python2.7 # Author: Keyu Li <kyli@link.cuhk.edu.hk> from __future__ import division import logging import os import torch import numpy as np from nav_msgs.msg import Odometry, OccupancyGrid import configparser import gym import tf from crowd_nav.policy.policy_factory import policy_factory from crowd_sim.env...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/scripts/__init__.py
sarl_star_ros/scripts/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/scripts/sarl_star_node.py
sarl_star_ros/scripts/sarl_star_node.py
#!/usr/bin/python2.7 # Author: Keyu Li <kyli@link.cuhk.edu.hk> from __future__ import division import logging import os import torch import numpy as np from nav_msgs.msg import Odometry, OccupancyGrid import configparser import gym import tf from crowd_nav.policy.policy_factory import policy_factory from crowd_sim.env...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/setup.py
sarl_star_ros/CrowdNav/setup.py
from setuptools import setup setup( name='crowdnav', version='0.0.1', packages=[ 'crowd_nav', 'crowd_nav.configs', 'crowd_nav.policy', 'crowd_nav.utils', 'crowd_sim', 'crowd_sim.envs', 'crowd_sim.envs.policy', 'crowd_sim.envs.utils', ], ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/__init__.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/__init__.py
from gym.envs.registration import register register( id='CrowdSim-v0', entry_point='crowd_sim.envs:CrowdSim', )
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/__init__.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/__init__.py
from .crowd_sim import CrowdSim
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/crowd_sim.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/crowd_sim.py
import logging import gym import matplotlib.lines as mlines import numpy as np import rvo2 import torch from matplotlib import patches from numpy.linalg import norm from crowd_sim.envs.utils.human import Human from crowd_sim.envs.utils.info import * from crowd_sim.envs.utils.utils import point_to_segment_dist class C...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/state.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/state.py
class FullState(object): def __init__(self, px, py, vx, vy, radius, gx, gy, v_pref, theta): self.px = px self.py = py self.vx = vx self.vy = vy self.radius = radius self.gx = gx self.gy = gy self.v_pref = v_pref self.theta = theta self...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/robot.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/robot.py
from crowd_sim.envs.utils.agent import Agent from crowd_sim.envs.utils.state import JointState class Robot(Agent): def __init__(self, config, section): super().__init__(config, section) def act(self, ob): if self.policy is None: raise AttributeError('Policy attribute has to be set...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/human.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/human.py
from crowd_sim.envs.utils.agent import Agent from crowd_sim.envs.utils.state import JointState class Human(Agent): def __init__(self, config, section): super().__init__(config, section) def act(self, ob): """ The state for human is its full state and all other agents' observable state...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/action.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/action.py
from collections import namedtuple ActionXY = namedtuple('ActionXY', ['vx', 'vy']) ActionRot = namedtuple('ActionRot', ['v', 'r'])
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/utils.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/utils.py
import numpy as np def point_to_segment_dist(x1, y1, x2, y2, x3, y3): """ Calculate the closest distance between point(x3, y3) and a line segment with two endpoints (x1, y1), (x2, y2) """ px = x2 - x1 py = y2 - y1 if px == 0 and py == 0: return np.linalg.norm((x3-x1, y3-y1)) u =...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/__init__.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/info.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/info.py
class Timeout(object): def __init__(self): pass def __str__(self): return 'Timeout' class ReachGoal(object): def __init__(self): pass def __str__(self): return 'Reaching goal' class Danger(object): def __init__(self, min_dist): self.min_dist = min_dist ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/agent.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/utils/agent.py
import numpy as np from numpy.linalg import norm import abc import logging from crowd_sim.envs.policy.policy_factory import policy_factory from crowd_sim.envs.utils.action import ActionXY, ActionRot from crowd_sim.envs.utils.state import ObservableState, FullState class Agent(object): def __init__(self, config, s...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/orca.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/orca.py
import numpy as np import rvo2 from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionXY class ORCA(Policy): def __init__(self): """ timeStep The time step of the simulation. Must be positive. neighborDist The default...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/policy.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/policy.py
import abc import numpy as np class Policy(object): def __init__(self): """ Base class for all policies, has an abstract method predict(). """ self.trainable = False self.phase = None self.model = None self.device = None self.last_state = None ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/__init__.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/linear.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/linear.py
import numpy as np from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionXY class Linear(Policy): def __init__(self): super().__init__() self.trainable = False self.kinematics = 'holonomic' self.multiagent_training = True def configure(s...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/policy_factory.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_sim/envs/policy/policy_factory.py
from crowd_sim.envs.policy.linear import Linear from crowd_sim.envs.policy.orca import ORCA def none_policy(): return None policy_factory = dict() policy_factory['linear'] = Linear policy_factory['orca'] = ORCA policy_factory['none'] = none_policy
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/train.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/train.py
import sys import logging import argparse import configparser import os import shutil import torch import gym import git from crowd_sim.envs.utils.robot import Robot from crowd_nav.utils.trainer import Trainer from crowd_nav.utils.memory import ReplayMemory from crowd_nav.utils.explorer import Explorer from crowd_nav.p...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/__init__.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/test.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/test.py
import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../') import logging import argparse import configparser import os import torch import numpy as np import gym from crowd_nav.utils.explorer import Explorer from crowd_nav.policy.policy_factory import policy_factory from crowd_sim.env...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/memory.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/memory.py
from torch.utils.data import Dataset # memory: list(state,value) class ReplayMemory(Dataset): def __init__(self, capacity): self.capacity = capacity self.memory = list() self.position = 0 def push(self, item): # replace old experience with new experience if len(self.me...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/plot.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/plot.py
import re import argparse import matplotlib.pyplot as plt import numpy as np def running_mean(x, n): cumsum = np.cumsum(np.insert(x, 0, 0)) return (cumsum[n:] - cumsum[:-n]) / float(n) def main(): parser = argparse.ArgumentParser() parser.add_argument('log_files', type=str, nargs='+') parser.add...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/trainer.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/trainer.py
import logging import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader class Trainer(object): def __init__(self, model, memory, device, batch_size): """ Train the trainable model of a policy """ self.model = mod...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/__init__.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/explorer.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/utils/explorer.py
import logging import copy import torch from crowd_sim.envs.utils.info import * class Explorer(object): def __init__(self, env, robot, device, memory=None, gamma=None, target_policy=None): self.env = env self.robot = robot self.device = device self.memory = memory self.gamm...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/configs/__init__.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/configs/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/lstm_rl.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/lstm_rl.py
import torch import torch.nn as nn import numpy as np import logging from crowd_nav.policy.cadrl import mlp from crowd_nav.policy.multi_human_rl import MultiHumanRL class ValueNetwork1(nn.Module): def __init__(self, input_dim, self_state_dim, mlp_dims, lstm_hidden_dim): super().__init__() self.sel...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/sarl.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/sarl.py
import torch import torch.nn as nn from torch.nn.functional import softmax import logging from crowd_nav.policy.cadrl import mlp from crowd_nav.policy.multi_human_rl import MultiHumanRL class ValueNetwork(nn.Module): def __init__(self, input_dim, self_state_dim, mlp1_dims, mlp2_dims, mlp3_dims, attention_dims, wi...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/cadrl.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/cadrl.py
import torch import torch.nn as nn import numpy as np import itertools import logging from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionRot, ActionXY from crowd_sim.envs.utils.state import ObservableState, FullState def mlp(input_dim, mlp_dims, last_relu=False): layers ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/__init__.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/multi_human_rl.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/multi_human_rl.py
import torch import numpy as np from crowd_sim.envs.utils.action import ActionRot, ActionXY from crowd_nav.policy.cadrl import CADRL class MultiHumanRL(CADRL): def __init__(self): super().__init__() def predict(self, state): """ A base class for all methods that takes pairwise joint s...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/policy_factory.py
sarl_star_ros/CrowdNav/build/lib.linux-x86_64-2.7/crowd_nav/policy/policy_factory.py
from crowd_sim.envs.policy.policy_factory import policy_factory from crowd_nav.policy.cadrl import CADRL from crowd_nav.policy.lstm_rl import LstmRL from crowd_nav.policy.sarl import SARL policy_factory['cadrl'] = CADRL policy_factory['lstm_rl'] = LstmRL policy_factory['sarl'] = SARL
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/__init__.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/__init__.py
from gym.envs.registration import register register( id='CrowdSim-v0', entry_point='crowd_sim.envs:CrowdSim', )
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/__init__.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/__init__.py
from .crowd_sim import CrowdSim
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/crowd_sim.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/crowd_sim.py
import logging import gym import matplotlib.lines as mlines import numpy as np import rvo2 import torch from matplotlib import patches from numpy.linalg import norm from crowd_sim.envs.utils.human import Human from crowd_sim.envs.utils.info import * from crowd_sim.envs.utils.utils import point_to_segment_dist class C...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/state.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/state.py
class FullState(object): def __init__(self, px, py, vx, vy, radius, gx, gy, v_pref, theta): self.px = px self.py = py self.vx = vx self.vy = vy self.radius = radius self.gx = gx self.gy = gy self.v_pref = v_pref self.theta = theta self...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/robot.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/robot.py
from crowd_sim.envs.utils.agent import Agent from crowd_sim.envs.utils.state import JointState class Robot(Agent): def __init__(self, config, section): super().__init__(config, section) def act(self, ob): if self.policy is None: raise AttributeError('Policy attribute has to be set...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/human.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/human.py
from crowd_sim.envs.utils.agent import Agent from crowd_sim.envs.utils.state import JointState class Human(Agent): def __init__(self, config, section): super().__init__(config, section) def act(self, ob): """ The state for human is its full state and all other agents' observable state...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/action.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/action.py
from collections import namedtuple ActionXY = namedtuple('ActionXY', ['vx', 'vy']) ActionRot = namedtuple('ActionRot', ['v', 'r'])
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/utils.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/utils.py
import numpy as np def point_to_segment_dist(x1, y1, x2, y2, x3, y3): """ Calculate the closest distance between point(x3, y3) and a line segment with two endpoints (x1, y1), (x2, y2) """ px = x2 - x1 py = y2 - y1 if px == 0 and py == 0: return np.linalg.norm((x3-x1, y3-y1)) u =...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/__init__.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/info.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/info.py
class Timeout(object): def __init__(self): pass def __str__(self): return 'Timeout' class ReachGoal(object): def __init__(self): pass def __str__(self): return 'Reaching goal' class Danger(object): def __init__(self, min_dist): self.min_dist = min_dist ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/agent.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/utils/agent.py
import numpy as np from numpy.linalg import norm import abc import logging from crowd_sim.envs.policy.policy_factory import policy_factory from crowd_sim.envs.utils.action import ActionXY, ActionRot from crowd_sim.envs.utils.state import ObservableState, FullState class Agent(object): def __init__(self, config, s...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/orca.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/orca.py
import numpy as np import rvo2 from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionXY class ORCA(Policy): def __init__(self): """ timeStep The time step of the simulation. Must be positive. neighborDist The default...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/policy.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/policy.py
import abc import numpy as np class Policy(object): def __init__(self): """ Base class for all policies, has an abstract method predict(). """ self.trainable = False self.phase = None self.model = None self.device = None self.last_state = None ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/__init__.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/linear.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/linear.py
import numpy as np from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionXY class Linear(Policy): def __init__(self): super().__init__() self.trainable = False self.kinematics = 'holonomic' self.multiagent_training = True def configure(s...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/policy_factory.py
sarl_star_ros/CrowdNav/build/lib/crowd_sim/envs/policy/policy_factory.py
from crowd_sim.envs.policy.linear import Linear from crowd_sim.envs.policy.orca import ORCA def none_policy(): return None policy_factory = dict() policy_factory['linear'] = Linear policy_factory['orca'] = ORCA policy_factory['none'] = none_policy
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/train.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/train.py
import sys import logging import argparse import configparser import os import shutil import torch import gym import git from crowd_sim.envs.utils.robot import Robot from crowd_nav.utils.trainer import Trainer from crowd_nav.utils.memory import ReplayMemory from crowd_nav.utils.explorer import Explorer from crowd_nav.p...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/__init__.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/test.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/test.py
import logging import argparse import configparser import os import torch import numpy as np import gym from crowd_nav.utils.explorer import Explorer from crowd_nav.policy.policy_factory import policy_factory from crowd_sim.envs.utils.robot import Robot from crowd_sim.envs.policy.orca import ORCA def main(): pars...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/memory.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/memory.py
from torch.utils.data import Dataset class ReplayMemory(Dataset): def __init__(self, capacity): self.capacity = capacity self.memory = list() self.position = 0 def push(self, item): # replace old experience with new experience if len(self.memory) < self.position + 1: ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/plot.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/plot.py
import re import argparse import matplotlib.pyplot as plt import numpy as np def running_mean(x, n): cumsum = np.cumsum(np.insert(x, 0, 0)) return (cumsum[n:] - cumsum[:-n]) / float(n) def main(): parser = argparse.ArgumentParser() parser.add_argument('log_files', type=str, nargs='+') parser.add...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/trainer.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/trainer.py
import logging import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader class Trainer(object): def __init__(self, model, memory, device, batch_size): """ Train the trainable model of a policy """ self.model = mode...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/__init__.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/explorer.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/utils/explorer.py
import logging import copy import torch from crowd_sim.envs.utils.info import * class Explorer(object): def __init__(self, env, robot, device, memory=None, gamma=None, target_policy=None): self.env = env self.robot = robot self.device = device self.memory = memory self.gamm...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/lstm_rl.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/lstm_rl.py
import torch import torch.nn as nn import numpy as np import logging from crowd_nav.policy.cadrl import mlp from crowd_nav.policy.multi_human_rl import MultiHumanRL class ValueNetwork1(nn.Module): def __init__(self, input_dim, self_state_dim, mlp_dims, lstm_hidden_dim): super().__init__() self.sel...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/sarl.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/sarl.py
import torch import torch.nn as nn from torch.nn.functional import softmax import logging from crowd_nav.policy.cadrl import mlp from crowd_nav.policy.multi_human_rl import MultiHumanRL class ValueNetwork(nn.Module): def __init__(self, input_dim, self_state_dim, mlp1_dims, mlp2_dims, mlp3_dims, attention_dims, wi...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/cadrl.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/cadrl.py
import torch import torch.nn as nn import numpy as np import itertools import logging from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionRot, ActionXY from crowd_sim.envs.utils.state import ObservableState, FullState def mlp(input_dim, mlp_dims, last_relu=False): layers ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/multi_human_rl.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/multi_human_rl.py
import torch import numpy as np from crowd_sim.envs.utils.action import ActionRot, ActionXY from crowd_nav.policy.cadrl import CADRL class MultiHumanRL(CADRL): def __init__(self): super().__init__() def predict(self, state): """ A base class for all methods that takes pairwise joint s...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/policy_factory.py
sarl_star_ros/CrowdNav/build/lib/crowd_nav/policy/policy_factory.py
from crowd_sim.envs.policy.policy_factory import policy_factory from crowd_nav.policy.cadrl import CADRL from crowd_nav.policy.lstm_rl import LstmRL from crowd_nav.policy.sarl import SARL policy_factory['cadrl'] = CADRL policy_factory['lstm_rl'] = LstmRL policy_factory['sarl'] = SARL
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/__init__.py
sarl_star_ros/CrowdNav/crowd_sim/__init__.py
from gym.envs.registration import register register( id='CrowdSim-v0', entry_point='crowd_sim.envs:CrowdSim', )
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/__init__.py
sarl_star_ros/CrowdNav/crowd_sim/envs/__init__.py
from .crowd_sim import CrowdSim
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/crowd_sim.py
sarl_star_ros/CrowdNav/crowd_sim/envs/crowd_sim.py
# Author: Changan Chen <changanvr@gmail.com> # Modified by: Keyu Li <kyli@link.cuhk.edu.hk> from __future__ import absolute_import import logging import gym import matplotlib.lines as mlines import numpy as np import rvo2 import torch from matplotlib import patches from numpy.linalg import norm from crowd_sim.envs.uti...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/utils/state.py
sarl_star_ros/CrowdNav/crowd_sim/envs/utils/state.py
class FullState(object): def __init__(self, px, py, vx, vy, radius, gx, gy, v_pref, theta): self.px = px self.py = py self.vx = vx self.vy = vy self.radius = radius self.gx = gx self.gy = gy self.v_pref = v_pref self.theta = theta self...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/utils/robot.py
sarl_star_ros/CrowdNav/crowd_sim/envs/utils/robot.py
from crowd_sim.envs.utils.agent import Agent from crowd_sim.envs.utils.state import JointState class Robot(Agent): def __init__(self, config, section): super(Robot, self).__init__(config, section) def act(self, ob): if self.policy is None: raise AttributeError('Policy attribute ha...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/utils/human.py
sarl_star_ros/CrowdNav/crowd_sim/envs/utils/human.py
from crowd_sim.envs.utils.agent import Agent from crowd_sim.envs.utils.state import JointState class Human(Agent): def __init__(self, config, section): super(Human,self).__init__(config, section) def act(self, ob): """ The state for human is its full state and all other agents' observ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/utils/action.py
sarl_star_ros/CrowdNav/crowd_sim/envs/utils/action.py
from collections import namedtuple ActionXY = namedtuple('ActionXY', ['vx', 'vy']) ActionRot = namedtuple('ActionRot', ['v', 'r'])
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/utils/utils.py
sarl_star_ros/CrowdNav/crowd_sim/envs/utils/utils.py
import numpy as np def point_to_segment_dist(x1, y1, x2, y2, x3, y3): """ Calculate the closest distance between point(x3, y3) and a line segment with two endpoints (x1, y1), (x2, y2) """ px = x2 - x1 py = y2 - y1 if px == 0 and py == 0: return np.linalg.norm((x3-x1, y3-y1)) u =...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/utils/__init__.py
sarl_star_ros/CrowdNav/crowd_sim/envs/utils/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/utils/info.py
sarl_star_ros/CrowdNav/crowd_sim/envs/utils/info.py
class Timeout(object): def __init__(self): pass def __str__(self): return 'Timeout' class ReachGoal(object): def __init__(self): pass def __str__(self): return 'Reaching goal' class Danger(object): def __init__(self, min_dist): self.min_dist = min_dist ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/utils/agent.py
sarl_star_ros/CrowdNav/crowd_sim/envs/utils/agent.py
from __future__ import division import numpy as np from numpy.linalg import norm import abc import logging from crowd_sim.envs.policy.policy_factory import policy_factory from crowd_sim.envs.utils.action import ActionXY, ActionRot from crowd_sim.envs.utils.state import ObservableState, FullState class Agent(object): ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/policy/orca.py
sarl_star_ros/CrowdNav/crowd_sim/envs/policy/orca.py
from __future__ import division import numpy as np import rvo2 from crowd_sim.envs.policy.policy import Policy from crowd_sim.envs.utils.action import ActionXY import logging class ORCA(Policy): def __init__(self): """ timeStep The time step of the simulation. Must b...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/policy/policy.py
sarl_star_ros/CrowdNav/crowd_sim/envs/policy/policy.py
import abc import numpy as np class Policy(object): def __init__(self): """ Base class for all policies, has an abstract method predict(). """ self.trainable = False self.phase = None self.model = None self.device = None self.last_state = None ...
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false
LeeKeyu/sarl_star
https://github.com/LeeKeyu/sarl_star/blob/179e314db9a447c64219f8f108a9aae8074b555f/sarl_star_ros/CrowdNav/crowd_sim/envs/policy/__init__.py
sarl_star_ros/CrowdNav/crowd_sim/envs/policy/__init__.py
python
MIT
179e314db9a447c64219f8f108a9aae8074b555f
2026-01-05T07:13:38.970356Z
false