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

Mirte ROS1 simulation #2

Open
wants to merge 73 commits into
base: ROS1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
0a93627
Fixes for ROS1 first launch
ArendJan Jun 28, 2023
b8f5b98
Teleop working
ArendJan Jun 29, 2023
7e9d212
Add duckytown generation + start sim
ArendJan Jul 19, 2023
00e1cc2
xmllint install workflow
ArendJan Jul 19, 2023
fbe93a1
change to tidy
ArendJan Jul 19, 2023
857ee7f
add format information readme
ArendJan Jul 19, 2023
49c29e5
fix workflow
ArendJan Jul 19, 2023
43f5cb7
fixes, but not working yet
ArendJan Jul 19, 2023
cbe4085
working control
ArendJan Jul 19, 2023
0351eaf
Add lidar
ArendJan Jul 19, 2023
8934bd8
sonar wip
ArendJan Jul 20, 2023
b52dbca
add sonar + fix formatting
ArendJan Jul 20, 2023
9c51b65
Add wheel encoders
ArendJan Jul 20, 2023
a341d1e
add encoder_speed
ArendJan Jul 20, 2023
cea2f75
Add intensity sensor
ArendJan Jul 21, 2023
0599291
Fix python styling map IR & Encoder
ArendJan Jul 21, 2023
4ff1e00
Add launch arguments
ArendJan Jul 21, 2023
46e8a06
Add encoder arguments
ArendJan Jul 21, 2023
d634699
Enable all and change lidar min_distance
ArendJan Jul 21, 2023
551ec0e
Add duckietown as model vs robot
ArendJan Jul 21, 2023
1a14ac6
World spawning done
ArendJan Jul 26, 2023
7bb9f4c
Add duckietown models!
ArendJan Jul 26, 2023
14f2194
Fix stylings
ArendJan Jul 26, 2023
6544282
Improve README and format worlds
ArendJan Jul 27, 2023
e29b44e
Add realsense_rs200
ArendJan Aug 3, 2023
5461096
Add realsense dependency comment
ArendJan Aug 3, 2023
4ad7cbf
Changed dimensions to move wheels, stylecheck yaml, fix realsense vis…
ArendJan Aug 3, 2023
9e185dc
New mirte_base and collision stl
ArendJan Aug 3, 2023
260df6d
Add lidar stl on top
ArendJan Aug 3, 2023
a3c2e52
Fix lidar styling
ArendJan Aug 3, 2023
3e230ea
Fix mirte not moving heavy caster
ArendJan Aug 3, 2023
193f188
start RCJ world
ArendJan Aug 3, 2023
d0f02a1
start rsp
ArendJan Aug 4, 2023
43798a8
revert lidar + add duckie material
ArendJan Aug 8, 2023
366b5f8
first working rsp
ArendJan Aug 9, 2023
bed8adf
working with lockstep
ArendJan Aug 9, 2023
36477a1
done rsp lab 4
ArendJan Aug 10, 2023
d164a28
Convert mapping to cpp
ArendJan Aug 11, 2023
46e46bc
change to other diff drive
ArendJan Aug 11, 2023
5810bcb
fix compile
ArendJan Aug 15, 2023
d2cdaba
fix compile + add generated world
ArendJan Aug 15, 2023
1937d25
Add lab 4 generated world
ArendJan Aug 15, 2023
f0ce9c7
Add lab4 launch file
ArendJan Aug 15, 2023
4d00d7d
Wider 'realsense' + fixes rsp
ArendJan Aug 15, 2023
1d7fcc6
Fix lab4 person detection
ArendJan Aug 16, 2023
26cb3fc
Add black tile rsp lab3
ArendJan Aug 16, 2023
d25adac
Merge branch 'rsp' of https://github.com/ArendJan/mirte-gazebo into rsp
ArendJan Aug 16, 2023
d93c231
cleanup of worlds and launch files
ArendJan Aug 16, 2023
5c4895f
Add lab4 launch file
ArendJan Aug 16, 2023
c66e176
cleanup empty duckietown
ArendJan Aug 16, 2023
1bc16fb
Stylecheck fixes
ArendJan Aug 16, 2023
914c387
Change sky color for person detection
ArendJan Aug 16, 2023
18c09c7
simplify stls for faster rendering
ArendJan Aug 16, 2023
2d8b414
Fix add joint controller for state publishing
ArendJan Aug 17, 2023
41a96b5
Convert encoder converter from python to cpp
ArendJan Aug 17, 2023
49370e5
Fix styling
ArendJan Aug 17, 2023
d1aafc0
Copy over realsense model to remove need for realsense_gazebo_plugin
ArendJan Aug 17, 2023
c3b866e
Fix spawn error because of sim time
ArendJan Aug 17, 2023
c4e4aad
Cleanup and buildMap fix
ArendJan Aug 17, 2023
5c87116
Cleanup and rosdep python-yaml
ArendJan Aug 17, 2023
8c57c93
Add cpp styling workflow and fixes
ArendJan Aug 17, 2023
078cb95
remove prius_msgs
ArendJan Aug 17, 2023
7710039
remove pcl_ros
ArendJan Aug 17, 2023
016003f
Add pcl dependency
ArendJan Aug 17, 2023
e1d62a8
Remove unnecesary code
ArendJan Aug 17, 2023
7cea82c
Remove unnecesary function
ArendJan Aug 17, 2023
6bf2cfb
add gazebo gui param labs
ArendJan Aug 17, 2023
3579406
Fix cpp styling
ArendJan Aug 18, 2023
6383097
change perspective gazebo user_camera
ArendJan Aug 18, 2023
82e11c2
Change camera to show overview
ArendJan Aug 18, 2023
cf66e2e
Add base_pose_ground_truth
ArendJan Aug 22, 2023
b7ccc7c
Add collision sensor mirte & realsense
ArendJan Sep 1, 2023
9681222
fix topics
ArendJan Sep 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .github/workflows/cpp-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: test-clang-format
on: [push, pull_request]
jobs:
cpp_style_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DoozyX/[email protected]
with:
source: '.'
# exclude: './third_party ./external'
extensions: 'h,cpp'
clangFormatVersion: 14
style: llvm
11 changes: 11 additions & 0 deletions .github/workflows/python-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: python style check
on: [push, pull_request]
jobs:
check-python-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Black Code Formatter
uses: lgeiger/black-action@master
with:
args: ". --check"
25 changes: 25 additions & 0 deletions .github/workflows/xmllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: test-xml-format
on: [push, pull_request]
# lint all xacro and launch files and check that there are no changes
# if changes: fail
jobs:
xml_style_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check xml changes
run: |
sudo apt update && sudo apt install libxml2-utils -y
./scripts/xmlformat.sh
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: |
**/*.xacro
**/*.launch
- name: Run step only when any of the above files change.
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |-
echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"
false
27 changes: 27 additions & 0 deletions .github/workflows/yamlfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: test-yaml-format
on: [push, pull_request]
jobs:
yaml_style_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '>=1.17.0'
- run: go version
- name: check yaml changes
run: |
go install github.com/google/yamlfmt/cmd/yamlfmt@latest
./scripts/yamlformat.sh
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: |
**/*.yaml
**/*.yml
- name: Run step only when any of the above files change.
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |-
echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"
false
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
build/
install/
log/
worlds/generated.world
urdf/generated.world
scripts/node_modules
205 changes: 17 additions & 188 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,205 +1,34 @@
cmake_minimum_required(VERSION 3.0.2)
project(mirte_gazebo)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
roscpp

)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )

## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# std_msgs
# )

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES mirte_gazebo
# CATKIN_DEPENDS rospy std_msgs
# DEPENDS system_lib
CATKIN_DEPENDS roscpp std_msgs mirte_msgs
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/mirte_gazebo.cpp
# )

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/mirte_gazebo_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# catkin_install_python(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )
find_package(catkin REQUIRED COMPONENTS roscpp sensor_msgs pcl_ros pcl_conversions mirte_msgs)

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
include_directories(${catkin_INCLUDE_DIRS})

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_mirte_gazebo.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
add_executable(rotate src/rotate.cpp)
add_dependencies(rotate ${catkin_EXPORTED_TARGETS})
target_link_libraries(rotate ${catkin_LIBRARIES} )

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
add_executable(convert_sonar src/convert_ultrasonic.cpp)
add_dependencies(convert_sonar ${catkin_EXPORTED_TARGETS})
target_link_libraries(convert_sonar ${catkin_LIBRARIES} )
add_executable(convert_ir src/convert_ir.cpp)
add_dependencies(convert_ir ${catkin_EXPORTED_TARGETS})
target_link_libraries(convert_ir ${catkin_LIBRARIES} )
add_executable(convert_encoder src/convert_encoder.cpp)
add_dependencies(convert_encoder ${catkin_EXPORTED_TARGETS})
target_link_libraries(convert_encoder ${catkin_LIBRARIES} )
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,36 @@

Have mirte-control and mirte-teleopkey installed

apt install ros-noetic-ros-control ros-noetic-ros-controllers

Requires https://github.com/SyrianSpock/realsense_gazebo_plugin to be downloaded and built if you want an actual realsense. realsense-depth uses a simple depth-camera without the realsense extras.


## running:

term1$ roslaunch mirte_gazebo gazebo_empty.launch
```sh
roslaunch mirte_gazebo gazebo_all.launch
```

Controlling the Mirte:
```sh
roslaunch mirte_teleop teleopkey.launch
```

Change world by changing the `duckietown` argument in `launch/gazebo_duckietown_world.launch` to any map in the maps folder.

The map file is converted to `urdf/generated.world` by `scripts/buildMap.py` and converted to `worlds/generated.world` by xacro before launching Gazebo.
<!-- term1$ roslaunch mirte_gazebo gazebo_empty_world.launch
term2$ roslaunch mirte_gazebo spawn_duckietown.launch
term3$ roslaunch mirte_gazebo spawn_mirte.launch
term4$ rosrun rviz rviz -d mirte_gazebo.rviz
term4$ rosrun rviz rviz -d mirte_gazebo.rviz -->

## Format
Format xml (.launch, .xacro and .world) by running
```sh
./scripts/xmlformat.sh # uses xmllint
```
and
```sh
./scripts/pythonformat.sh # uses black
```
10 changes: 4 additions & 6 deletions config/gazebo_ros_control_params.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
gazebo_ros_control:
gazebo_ros_control:
pid_gains:
joint_left_wheel:
p: 0.06
i: 0.0
p: 0.1
i: 0.0
d: 0.0
joint_right_wheel:
p: 0.06
p: 0.1
i: 0.0
d: 0.0


Loading