Skip to content

Commit

Permalink
docker-compose for ros
Browse files Browse the repository at this point in the history
  • Loading branch information
ksquaring committed Nov 3, 2024
1 parent d1d6f34 commit e8cfda9
Show file tree
Hide file tree
Showing 194 changed files with 6,781 additions and 0 deletions.
1 change: 1 addition & 0 deletions ros/build/.built_by
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
colcon
Empty file added ros/build/COLCON_IGNORE
Empty file.
Empty file.
39 changes: 39 additions & 0 deletions ros/build/my_package/build/lib/my_package/my_robot_driver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import rclpy
from geometry_msgs.msg import Twist

HALF_DISTANCE_BETWEEN_WHEELS = 0.045
WHEEL_RADIUS = 0.025

class MyRobotDriver:
def init(self, webots_node, properties):
self.__robot = webots_node.robot

self.__left_motor = self.__robot.getDevice('left wheel motor')
self.__right_motor = self.__robot.getDevice('right wheel motor')

self.__left_motor.setPosition(float('inf'))
self.__left_motor.setVelocity(0)

self.__right_motor.setPosition(float('inf'))
self.__right_motor.setVelocity(0)

self.__target_twist = Twist()

rclpy.init(args=None)
self.__node = rclpy.create_node('my_robot_driver')
self.__node.create_subscription(Twist, 'cmd_vel', self.__cmd_vel_callback, 1)

def __cmd_vel_callback(self, twist):
self.__target_twist = twist

def step(self):
rclpy.spin_once(self.__node, timeout_sec=0)

forward_speed = self.__target_twist.linear.x
angular_speed = self.__target_twist.angular.z

command_motor_left = (forward_speed - angular_speed * HALF_DISTANCE_BETWEEN_WHEELS) / WHEEL_RADIUS
command_motor_right = (forward_speed + angular_speed * HALF_DISTANCE_BETWEEN_WHEELS) / WHEEL_RADIUS

self.__left_motor.setVelocity(command_motor_left)
self.__right_motor.setVelocity(command_motor_right)
1 change: 1 addition & 0 deletions ros/build/my_package/colcon_build.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions ros/build/my_package/colcon_command_prefix_setup_py.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# generated from colcon_core/shell/template/command_prefix.sh.em
71 changes: 71 additions & 0 deletions ros/build/my_package/colcon_command_prefix_setup_py.sh.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
AMENT_PREFIX_PATH=/opt/ros/humble
COLCON=1
COLCON_PREFIX_PATH=/home/ksquared/humanoid/ros/my_package
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DESKTOP_SESSION=ubuntu-wayland
DISPLAY=:1
FLYCTL_INSTALL=/home/ksquared/.fly
GDMSESSION=ubuntu-wayland
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_SETUP_DISPLAY=:2
GNOME_SHELL_SESSION_MODE=ubuntu
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/60edb008_b8c1_42ea_b45f_cda16035a0e8
GNOME_TERMINAL_SERVICE=:1.178
GTK_MODULES=gail:atk-bridge
HOME=/home/ksquared
LANG=en_US.UTF-8
LD_LIBRARY_PATH=/opt/ros/humble/opt/rviz_ogre_vendor/lib:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib
LESS=-R
LOGNAME=ksquared
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
NVM_BIN=/home/ksquared/.nvm/versions/node/v22.1.0/bin
NVM_CD_FLAGS=-q
NVM_DIR=/home/ksquared/.nvm
NVM_INC=/home/ksquared/.nvm/versions/node/v22.1.0/include/node
OLDPWD=/home/ksquared/humanoid/ros/my_package
P9K_SSH=0
P9K_TTY=old
PAGER=less
PATH=/opt/ros/humble/bin:/home/ksquared/.pyenv/plugins/pyenv-virtualenv/shims:/home/ksquared/.pyenv/shims:/home/ksquared/.pyenv/bin:/home/ksquared/.local/bin:/home/ksquared/.fly/bin:/home/ksquared/.nvm/versions/node/v22.1.0/bin:/home/ksquared/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PWD=/home/ksquared/humanoid/ros/build/my_package
PYENV_ROOT=/home/ksquared/.pyenv
PYENV_SHELL=zsh
PYENV_VIRTUALENV_INIT=1
PYTHONPATH=/opt/ros/humble/lib/python3.10/site-packages:/opt/ros/humble/local/lib/python3.10/dist-packages
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
ROS_DISTRO=humble
ROS_LOCALHOST_ONLY=0
ROS_PYTHON_VERSION=3
ROS_VERSION=2
SESSION_MANAGER=local/ksquared:@/tmp/.ICE-unix/3142,unix/ksquared:/tmp/.ICE-unix/3142
SHELL=/usr/bin/zsh
SHLVL=1
SSH_AGENT_LAUNCHER=gnome-keyring
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
SYSTEMD_EXEC_PID=26366
TERM=xterm-256color
USER=ksquared
USERNAME=ksquared
VTE_VERSION=6800
WAYLAND_DISPLAY=wayland-0
WEBOTS_HOME=/usr/local/webots
XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.JGGFW2
XDG_CACHE_HOME=/home/ksquared/.cache
XDG_CONFIG_HOME=/home/ksquared/.config
XDG_CURRENT_DESKTOP=ubuntu:GNOME
XDG_DATA_DIRS=/home/ksquared/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_DATA_HOME=/home/ksquared/.local/share
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=ubuntu-wayland
XDG_SESSION_TYPE=wayland
XDG_STATE_HOME=/home/ksquared/.local/state
XMODIFIERS=@im=ibus
ZSH=/home/ksquared/.oh-my-zsh
_=/usr/bin/colcon
_P9K_SSH_TTY=/dev/pts/5
_P9K_TTY=/dev/pts/5
17 changes: 17 additions & 0 deletions ros/build/my_package/install.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package/my_robot_driver.py
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package/__init__.py
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package/__pycache__/my_robot_driver.cpython-310.pyc
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package/__pycache__/__init__.cpython-310.pyc
/home/ksquared/humanoid/ros/install/my_package/share/ament_index/resource_index/packages/my_package
/home/ksquared/humanoid/ros/install/my_package/share/my_package/launch/robot_launch.py
/home/ksquared/humanoid/ros/install/my_package/share/my_package/worlds/my_world.wbt
/home/ksquared/humanoid/ros/install/my_package/share/my_package/resource/my_robot.urdf
/home/ksquared/humanoid/ros/install/my_package/share/my_package/package.xml
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package-0.0.0-py3.10.egg-info/dependency_links.txt
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package-0.0.0-py3.10.egg-info/SOURCES.txt
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package-0.0.0-py3.10.egg-info/requires.txt
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package-0.0.0-py3.10.egg-info/entry_points.txt
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package-0.0.0-py3.10.egg-info/PKG-INFO
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package-0.0.0-py3.10.egg-info/top_level.txt
/home/ksquared/humanoid/ros/install/my_package/lib/python3.10/site-packages/my_package-0.0.0-py3.10.egg-info/zip-safe
/home/ksquared/humanoid/ros/install/my_package/lib/my_package/my_robot_driver
9 changes: 9 additions & 0 deletions ros/build/my_package/my_package.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Metadata-Version: 2.1
Name: my_package
Version: 0.0.0
Summary: TODO: Package description
Maintainer: user
Maintainer-email: user.name@mail.com
License: TODO: License declaration
License-File: LICENSE
Requires-Dist: setuptools
20 changes: 20 additions & 0 deletions ros/build/my_package/my_package.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
LICENSE
package.xml
setup.cfg
setup.py
../build/my_package/my_package.egg-info/PKG-INFO
../build/my_package/my_package.egg-info/SOURCES.txt
../build/my_package/my_package.egg-info/dependency_links.txt
../build/my_package/my_package.egg-info/entry_points.txt
../build/my_package/my_package.egg-info/requires.txt
../build/my_package/my_package.egg-info/top_level.txt
../build/my_package/my_package.egg-info/zip-safe
launch/robot_launch.py
my_package/__init__.py
my_package/my_robot_driver.py
resource/my_package
resource/my_robot.urdf
test/test_copyright.py
test/test_flake8.py
test/test_pep257.py
worlds/my_world.wbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions ros/build/my_package/my_package.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[console_scripts]
my_robot_driver = my_package.my_robot_driver:main
1 change: 1 addition & 0 deletions ros/build/my_package/my_package.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setuptools
1 change: 1 addition & 0 deletions ros/build/my_package/my_package.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
my_package
1 change: 1 addition & 0 deletions ros/build/my_package/my_package.egg-info/zip-safe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
4 changes: 4 additions & 0 deletions ros/build/my_package/prefix_override/sitecustomize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import sys
if sys.prefix == '/usr':
sys.real_prefix = sys.prefix
sys.prefix = sys.exec_prefix = '/home/ksquared/humanoid/ros/install/my_package'
1 change: 1 addition & 0 deletions ros/install/.colcon_install_layout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
isolated
Empty file added ros/install/COLCON_IGNORE
Empty file.
Loading

0 comments on commit e8cfda9

Please sign in to comment.