Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New assessment environments #43

Merged
merged 5 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
[submodule "uol_turtlebot_simulator/gzmaze"]
path = uol_turtlebot_simulator/gzmaze
url = https://github.com/LCAS/gzmaze.git
branch = melodic
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
LCAS Teaching Repo
========

A repository for all the teaching stuff (mainly CMP3103M)
A repository for all the teaching stuff (mainly CMP3103)



## Some useful launch commands

### Nav2

Run a full navigation stack (requires additional packages), see https://navigation.ros.org/getting_started/index.html

```
ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False world:=/opt/ros/lcas_addons/install/uol_turtlebot_simulator/share/uol_turtlebot_simulator/worlds/object-search-training.world slam:=True autostart:=True x_pose:=0.0 y_pose:=0.0
```

1 change: 0 additions & 1 deletion uol_tidybot/env-hooks/90.gazebo_models_uol.dsv.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
prepend-non-duplicate;GAZEBO_MODEL_PATH;share/@PROJECT_NAME@/models
prepend-non-duplicate;GAZEBO_RESOURCE_PATH;share/@PROJECT_NAME@/models;share/@PROJECT_NAME@/worlds
set-if-unset;TURTLEBOT3_MODEL;waffle
26 changes: 14 additions & 12 deletions uol_tidybot/launch/tidybot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
from launch.actions import DeclareLaunchArgument, ExecuteProcess, IncludeLaunchDescription
from launch.conditions import IfCondition, UnlessCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, LaunchConfiguration, PythonExpression
from launch.substitutions import Command, LaunchConfiguration, PythonExpression, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from ament_index_python.packages import get_package_share_directory


def generate_launch_description():

# Constants for paths to different files and folders
# setting defaults
urdf_model_name = 'tidybot.gazebo'
world_file_name = 'level_1_1.world'
rviz_config_file_name = 'urdf.rviz'
default_world = 'level_1_1.world'

robot_name_in_model = 'limo_gazebosim'

Expand All @@ -30,18 +30,20 @@ def generate_launch_description():

# Set the path to different files and folders.
pkg_gazebo_ros = FindPackageShare(package='gazebo_ros').find('gazebo_ros')
pkg_uol_tidybot = FindPackageShare(package='uol_tidybot').find('uol_tidybot')

default_urdf_model_path = os.path.join(
get_package_share_directory('uol_tidybot'),
'urdf',
urdf_model_name
)

world_path = os.path.join(
get_package_share_directory('uol_tidybot'),
'worlds',
world_file_name
)
#world_path_prefix = os.path.join(
# get_package_share_directory('uol_tidybot'),
# 'worlds'
#)

world_path_prefix = PathJoinSubstitution([FindPackageShare('uol_tidybot'), 'worlds'])

gazebo_models_path = os.path.join(
get_package_share_directory('uol_tidybot'),
Expand All @@ -68,7 +70,7 @@ def generate_launch_description():
use_robot_state_pub = LaunchConfiguration('use_robot_state_pub')
use_rviz = LaunchConfiguration('use_rviz')
use_simulator = LaunchConfiguration('use_simulator')
world = LaunchConfiguration('world')
world = LaunchConfiguration('world', default=default_world)

remappings = [((namespace, '/tf'), '/tf'),
((namespace, '/tf_static'), '/tf_static'),
Expand Down Expand Up @@ -128,8 +130,8 @@ def generate_launch_description():

declare_world_cmd = DeclareLaunchArgument(
name='world',
default_value=world_path,
description='Full path to the world model file to load')
default_value=default_world,
description='Name of the world file in uol_tidybot package')

# Subscribe to the joint states of the robot, and publish the 3D pose of each link.
start_robot_state_publisher_cmd = Node(
Expand Down Expand Up @@ -174,7 +176,7 @@ def generate_launch_description():
start_gazebo_server_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py')),
condition=IfCondition(use_simulator),
launch_arguments={'world': world}.items())
launch_arguments={'world': PathJoinSubstitution([world_path_prefix, world])}.items())

# Start Gazebo client
start_gazebo_client_cmd = IncludeLaunchDescription(
Expand Down
14 changes: 14 additions & 0 deletions uol_tidybot/models/dice_simple_red/meshes/6cm cubes 4x.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Color definition for Tinkercad Obj File 2015

newmtl color_4634441
Ka 0 0 0
Kd 0.27450980392156865 0.7176470588235294 0.28627450980392155
d 1
illum 0.0

newmtl color_15277357
Ka 0 0 0
Kd 0.9137254901960784 0.11372549019607843 0.17647058823529413
d 1
illum 0.0

103 changes: 103 additions & 0 deletions uol_tidybot/models/dice_simple_red/meshes/6cm cubes 4x.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Object Export From Tinkercad Server 2015

mtllib obj.mtl

o obj_0
v 70 -71 60
v 70 -71 0
v 70 -11 0
v 70 -11 60
v 70 -1 60
v 70 -1 0
v 70 59 0
v 70 59 60
v 0 -71 60
v 0 -71 0
v 0 -11 0
v 0 -1 60
v 0 -11 60
v 0 -1 0
v 0 59 0
v 0 59 60
v -60 -11 60
v -60 -11 0
v -60 -71 0
v -60 -71 60
v -60 59 60
v -60 59 0
v -60 -1 0
v -60 -1 60
v 10 59 0
v 10 59 60
v 10 -1 0
v 10 -1 60
v 10 -11 60
v 10 -71 60
v 10 -11 0
v 10 -71 0
# 32 vertices

g group_0_4634441

usemtl color_4634441
s 0

f 1 2 3
f 1 3 4
f 9 10 11
f 9 11 13
f 17 18 19
f 17 19 20
f 13 17 20
f 13 20 9
f 13 11 18
f 13 18 17
f 4 29 30
f 4 30 1
f 29 31 32
f 29 32 30
f 10 19 18
f 10 18 11
f 2 32 31
f 2 31 3
f 20 19 10
f 20 10 9
f 30 32 2
f 30 2 1
f 4 3 31
f 4 31 29
# 24 faces

g group_0_15277357

usemtl color_15277357
s 0

f 5 6 7
f 5 7 8
f 12 14 15
f 12 15 16
f 21 22 23
f 21 23 24
f 8 7 25
f 8 25 26
f 24 23 14
f 24 14 12
f 26 25 27
f 26 27 28
f 16 15 22
f 16 22 21
f 16 21 24
f 16 24 12
f 8 26 28
f 8 28 5
f 14 23 22
f 14 22 15
f 6 27 25
f 6 25 7
f 28 27 6
f 28 6 5
# 24 faces

#end of obj_0

45 changes: 45 additions & 0 deletions uol_tidybot/models/dice_simple_red/meshes/dice_simple.dae
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<author>VCGLab</author>
<authoring_tool>VCGLib | MeshLab</authoring_tool>
</contributor>
<created>Mon Jan 15 11:28:00 2024 GMT</created>
<modified>Mon Jan 15 11:28:00 2024 GMT</modified>
<up_axis>Y_UP</up_axis>
</asset>
<library_geometries>
<geometry id="shape0-lib" name="shape0">
<mesh>
<source id="shape0-lib-positions" name="position">
<float_array id="shape0-lib-positions-array" count="24">-0.03 -0.03 0.03 0.03 -0.03 0.03 0.03 0.03 0.03 -0.03 0.03 0.03 0.03 0.03 -0.03 -0.03 0.03 -0.03 0.03 -0.03 -0.03 -0.03 -0.03 -0.03</float_array>
<technique_common>
<accessor count="8" source="#shape0-lib-positions-array" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="shape0-lib-vertices">
<input semantic="POSITION" source="#shape0-lib-positions"/>
</vertices>
<triangles count="12">
<input offset="0" semantic="VERTEX" source="#shape0-lib-vertices"/>
<p>3 2 4 3 4 5 0 1 2 0 2 3 5 4 6 5 6 7 7 6 1 7 1 0 1 6 4 1 4 2 7 0 3 7 3 5</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="VisualSceneNode" name="VisualScene">
<node id="node" name="node">
<instance_geometry url="#shape0-lib"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#VisualSceneNode"/>
</scene>
</COLLADA>
6 changes: 6 additions & 0 deletions uol_tidybot/models/dice_simple_red/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" ?>
<model>
<name>dice_simple_red</name>
<description>a model of a red dice_simple</description>
<sdf version="1.5">model.sdf</sdf>
</model>
61 changes: 61 additions & 0 deletions uol_tidybot/models/dice_simple_red/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="dice_simple_red">
<link name="link">
<inertial>
<pose> 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0 0 0 </pose>
<mass> 0.02 </mass>
<inertia>
<ixx> 3.3333332480e-03 </ixx>
<ixy> 0.0000000000e+00 </ixy>
<ixz> 0.0000000000e+00 </ixz>
<iyy> 3.3333332480e-03 </iyy>
<iyz> 0.0000000000e+00 </iyz>
<izz> 3.3333332480e-03 </izz>
</inertia>
</inertial>
<collision name="collision">
<pose> 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0 0 0 </pose>
<geometry>
<mesh>
<uri>model://dice_simple_red/meshes/dice_simple.dae</uri>
</mesh>
</geometry>
<surface>
<friction>
<ode>
<mu>0.1</mu>
<mu2>0.1</mu2>
</ode>
</friction>
<!-- <contact>
<ode>
<kp>10000000.0</kp>
<kd>1.0</kd>
<min_depth>0.001</min_depth>
<max_vel>0.1</max_vel>
</ode>
</contact> -->
</surface>
</collision>
<visual name="visual">
<pose> 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0 0 0 </pose>
<geometry>
<mesh>
<uri>model://dice_simple_red/meshes/dice_simple.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Red</name>
</script>
</material>
</visual>
<velocity_decay>
<linear>0</linear>
<angular>0.005</angular>
</velocity_decay>
</link>
</model>
</sdf>
2 changes: 2 additions & 0 deletions uol_tidybot/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
(path.join('share', package_name, 'worlds'), glob(path.join('worlds', '*.world'))),
(path.join('share', package_name, 'models', 'dice_simple'), glob(path.join('models', 'dice_simple', 'model.*'))),
(path.join('share', package_name, 'models', 'dice_simple','meshes'), glob(path.join('models', 'dice_simple', 'meshes', '*.dae'))),
(path.join('share', package_name, 'models', 'dice_simple_red'), glob(path.join('models', 'dice_simple_red', 'model.*'))),
(path.join('share', package_name, 'models', 'dice_simple_red','meshes'), glob(path.join('models', 'dice_simple_red', 'meshes', '*.dae'))),
(path.join('share', package_name, 'meshes'), glob(path.join('meshes', '*'))),
],
install_requires=['setuptools'],
Expand Down
Loading
Loading