diff --git a/README.md b/README.md index dc0d96b173a3921b8cac60be271e03cc931cd81b..c9d549eb9390cd96546e4e3173e28a5eb12e3731 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,32 @@ -# turtlebot2 - - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +# TurtleBot2 Bibo - Documentation +The Turtlebot 2 is a mobile robot that is commonly used for academic research in sensor fusion, slaming and path planning. +\ +This is the documentation on how to update the TurtleBot2 to ROS2. + +### SOURCING THE WORKSPACE WITH EVERY OPENED TAB ``` -cd existing_repo -git remote add origin https://git-ce.rwth-aachen.de/turtlebot_igmr/turtlebot2.git -git branch -M main -git push -uf origin main +gedit ~/.bashrc ``` +at end of file add +``` +source /opt/ros/humble/setup.bash #so we can access ros2 +source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash +source ~/ros2_ws/install/setup.bash # access own workspace +source ~/ros2_ws/kobuki/install/setup.bash +source ~/ros2_ws/lidar/install/setup.bash +``` +save it -## Integrate with your tools - -- [ ] [Set up project integrations](https://git-ce.rwth-aachen.de/turtlebot_igmr/turtlebot2/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README - -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. +### INSTALL WITH FILES IN INSTALL FOLDER -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. +[kobuki install](https://git.rwth-aachen.de/coco-schwarz/turtlebot2-bibo-documentation/-/blob/main/install/kobuki.md?ref_type=heads) \ +[teleop install](https://git.rwth-aachen.de/coco-schwarz/turtlebot2-bibo-documentation/-/blob/main/install/teleop.md?ref_type=heads) \ +[lidar install](https://git.rwth-aachen.de/coco-schwarz/turtlebot2-bibo-documentation/-/blob/main/install/lidar.md?ref_type=heads) \ +[slamtoolbox install](https://git.rwth-aachen.de/coco-schwarz/turtlebot2-bibo-documentation/-/blob/main/install/slamtoolbox.md?ref_type=heads) -## License -For open source projects, say how it is licensed. +### LAUNCH WITH FILES IN LAUNCH FOLDER -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +[kobuki & teleop launch](https://git.rwth-aachen.de/coco-schwarz/turtlebot2-bibo-documentation/-/blob/main/launch/kobuki-teleop.md?ref_type=heads) \ +[lidar launch](https://git.rwth-aachen.de/coco-schwarz/turtlebot2-bibo-documentation/-/blob/main/launch/lidar.md?ref_type=heads) \ +[slamtoolbox launch](https://git.rwth-aachen.de/coco-schwarz/turtlebot2-bibo-documentation/-/blob/main/launch/slamtoolbox.md?ref_type=heads) diff --git a/install/kobuki.md b/install/kobuki.md new file mode 100644 index 0000000000000000000000000000000000000000..daa35d61b226e4b2ee0d84c0c8dee71736d5f122 --- /dev/null +++ b/install/kobuki.md @@ -0,0 +1,35 @@ +ros2_ws/ \ + create a kobuki Folder \ +ros2_ws/kobuki/ \ + create a src Folder + +ros2_ws/ +``` +sudo rosdep init +rosdep update +``` +``` +sudo apt update +sudo apt install ros-humble-ament-cmake-ros +sudo apt-get install ros-humble-kobuki-ros-interfaces +sudo apt.get install ros-humble-kobuki-velocity-smoother +sudo apt-get install ros-humble-sophus +sudo apt install ros-humble-ecl-build +sudo apt install libspnav-dev +``` +check that all of them have been installed + +ros2_ws/kobuki/src/ +``` +git clone https://github.com/kobuki-base/kobuki_core.git +git clone https://github.com/kobuki-base/kobuki_ros.git +git clone https://github.com/kobuki-base/kobuki_ros_interfaces.git +git clone https://github.com/kobuki-base/cmd_vel_mux.git +git clone https://github.com/stonier/ecl_core.git +git clone https://github.com/stonier/ecl_lite.git +``` +ros2_ws/kobuki/ +``` +rosdep install -i --from-path src --rosdistro humble -y +colcon build --symlink-install +``` \ No newline at end of file diff --git a/install/lidar.md b/install/lidar.md new file mode 100644 index 0000000000000000000000000000000000000000..ccb3ef4fd2bdbdee7e8b60970b999612203b08bd --- /dev/null +++ b/install/lidar.md @@ -0,0 +1,17 @@ +ros2_ws/ \ + create a lidar folder +ros2_ws/lidar/ \ + create a src Folder +``` +sudo apt install ros-humble-rplidar-ros +``` + +ros2_ws/lidar/src/ +``` +git clone https://github.com/allenh1/rplidar_ros/tree/ros2/ +``` + +ros2_ws/lidar/ +``` +colcon build --packages-select rplidar_ros --symlink-install +``` \ No newline at end of file diff --git a/install/slamtoolbox.md b/install/slamtoolbox.md new file mode 100644 index 0000000000000000000000000000000000000000..8d39b01ae3f2ec1cc770c94ed4be711c83c169dd --- /dev/null +++ b/install/slamtoolbox.md @@ -0,0 +1,27 @@ +``` +sudo apt install ros-humble-slam-toolbox +``` + +Copy config file to our ws in order to change it +``` +cd /opt/ros/humble/slam_toolbox/config/mapper_params_online_async.yaml ros2_ws/lidar/src/ +``` + +open this yaml file and change to \ +base_frame: base_link\ +save file + +ros2_ws/lidar/src/ +``` +git clone https://github.com/MAPIRlab/rf2o_laser_odometry.git +``` + +ros2_ws/lidar/src/rf2o-laser_odomerty/launch/rf2o-laser_odomerty.launch.py/ \ + Change odom_topic' : '/odom', \ + save file + +ros2_ws/lidar/src/rf2o-laser_odomerty/ +``` +colcon build --symlink-install +``` +When it does not work the first time, build again. diff --git a/install/teleop.md b/install/teleop.md new file mode 100644 index 0000000000000000000000000000000000000000..3a58ed1aea2be771fb6147967d730f954b5a6315 --- /dev/null +++ b/install/teleop.md @@ -0,0 +1,38 @@ +ros2_ws/kobuki/src +``` +git clone https://github.com/ros2/teleop_twist_keyboard.git +git clone -b ros2 https://github.com/ros-drivers/joystick_drivers.git +git clone https://github.com/ros2/teleop_twist_joy.git +``` + +ros2_ws/kobuki +``` +rosdep install --from-paths src --ignore-src -r -y +colcon build --symlink-install +``` +if joystick does not work, then add yaml to system wide location +``` +sudo cp ~/ros2_ws/kobuki/src/teleop_twist_joy/config/pdp.config.yaml /opt/ros/humble/share/teleop_twist_joy/config/ +``` + +BLUETOOTH +``` +sudo apt-get install bluez +sudo nano /etc/bluetooth/input.conf +``` +change: \ + # ClassicBondedOnly=true --> ClassicBondedOnly=false \ +after changes: \ + strg + O, strg + X + + +connect joypad via cable \ +press allow button \ +detach cable from NUC \ +press P button to connect via Bluetooth + +if it does not work, check USB Connection. For us this worked: \ + + back-top:kobuki, back-bottom:joypad + front-left:lidar + diff --git a/launch/kobuki-teleop.md b/launch/kobuki-teleop.md new file mode 100644 index 0000000000000000000000000000000000000000..8e65537a012a6e5a1e7a528efd244c8ab4a78637 --- /dev/null +++ b/launch/kobuki-teleop.md @@ -0,0 +1,16 @@ +terminal 1: +``` +ros2 launch kobuki_node kobuki_node-launch.py +``` + +terminal 2: +``` +ros2 launch teleop_twist_joy teleop-launch.py joy_config:='pdp' joy_vel:='commands/velocity' +``` + +connect joystick via bluetooth (press P button) + +see if buttons are working +``` +ros2 topic echo /joy +``` diff --git a/launch/lidar.md b/launch/lidar.md new file mode 100644 index 0000000000000000000000000000000000000000..d66b9868c1d19eba86d515f09cb76bee9fa0909a --- /dev/null +++ b/launch/lidar.md @@ -0,0 +1,20 @@ +terminal 1: +``` +ros2 launch rplidar_ros view_rplidar.launch.py +``` + +if you do not use slamtoolbox launch: \ +terminal 2: +``` +ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link laser +``` + +## commands in 3rd terminal +stop motor +``` +ros2 service call /stop_motor std_srvs/srv/Empty +``` +start motor +``` +ros2 service call /start_motor std_srvs/srv/Empty +``` \ No newline at end of file diff --git a/launch/slamtoolbox.md b/launch/slamtoolbox.md new file mode 100644 index 0000000000000000000000000000000000000000..c2192bc57926ed8cd3d7c0565a5c5fc4add17dda --- /dev/null +++ b/launch/slamtoolbox.md @@ -0,0 +1,37 @@ +## STATIC TRANSFORMATIONS + +A static transformations is needed so that RViz knows the relation between the robots's frame and the LiDAR sensor's frame. It states the translation and rotation between the two. + +terminal 1: +``` +ros2 run tf2_ros static_transform_publisher "0" "0" "0" "0" "0" "0" "map" "scan" +``` +terminal 2: +``` +ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 odom base_link +``` +terminal 3: +``` +ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link laser +``` +terminal 4: +``` +ros2 launch rf2o_laser_odometry rf2o_laser_odometry.launch.py +``` + + +## PYTHON LAUNCH METHOD +terminal 5: +``` +ros2 run slam_toolbox sync_slam_toolbox_node \ +in command line after add: +--ros-args -p odom_frame:=odom --ros-args -p base_frame:=base_link --ros-args -p map_frame:=map --ros-args -p scan_topic:=/scan --ros-args -p map_update_interval:=1.0 --ros-args -p max_laser_range:=5.0 --ros-args -p minimum_travel_distance:=0.1 --ros-args -p use_scan_matching:=true --ros-args -p minimum_travel_heading:=1.57 --ros-args -p do_loop_closing:=true +``` + +## RVIZ + add Map by topic /map + change fixed frame --> /map + then map is fixed and lidar can move with out the frame moving + + \ +ros2 param get /slam_toolbox