From cdea73fdd7f7f95278e9a4adef0cd07c8605f138 Mon Sep 17 00:00:00 2001 From: locker98 Date: Sat, 7 Dec 2024 20:17:10 -0500 Subject: [PATCH] update website --- .../Building ROS2 packages.md | 43 ++++----- .../Installing Tools.md} | 13 ++- .../Building ROS 2 Packages/Message Types.md | 28 ++++++ .../Building ROS 2 Packages/Publisher.md | 80 ++++++++++++++++ .../ROS 2 Dependencies.md | 91 +++++++++++++++++++ .../Building ROS 2 Packages/Subscriber.md | 67 ++++++++++++++ docs/General ROS 2/Debugging.md | 38 ++++++++ docs/General ROS 2/Debuging.md | 8 -- .../Micro ROS/Micro ROS Bridge.md | 59 ++++++++++++ docs/General ROS 2/ROS 2 Nodes.md | 26 +++++- docs/General ROS 2/ROS 2 Topics.md | 29 ++++++ .../TurtleSim/Turtlesim Overview.md | 18 ++++ docs/Husky 200/Husky 200 Simulator.md | 19 ++++ .../Husky 200/{Simulator.md => Robot.yaml.md} | 33 ++----- docs/Husky 200/Visualizing robot.yaml.md | 3 - docs/TurtleBot 4/Oak D Pro Camera.md | 2 + docs/TurtleBot 4/SLAM and Navigation.md | 7 +- .../{Setup.md => Setting Up Turtlebot 4.md} | 4 +- ...mands.md => Turtlebot 4 ROS 2 Commands.md} | 1 + .../Updating ROS on Turtlebot 4.md | 1 + .../Viewing Turtlebot 4 Sensor Data.md | 1 + mkdocs.yml | 2 + 22 files changed, 504 insertions(+), 69 deletions(-) rename docs/General ROS 2/{ => Building ROS 2 Packages}/Building ROS2 packages.md (86%) rename docs/General ROS 2/{Colcon.md => Building ROS 2 Packages/Installing Tools.md} (59%) create mode 100755 docs/General ROS 2/Building ROS 2 Packages/Message Types.md create mode 100755 docs/General ROS 2/Building ROS 2 Packages/Publisher.md create mode 100755 docs/General ROS 2/Building ROS 2 Packages/ROS 2 Dependencies.md create mode 100755 docs/General ROS 2/Building ROS 2 Packages/Subscriber.md create mode 100755 docs/General ROS 2/Debugging.md delete mode 100755 docs/General ROS 2/Debuging.md create mode 100755 docs/General ROS 2/Micro ROS/Micro ROS Bridge.md create mode 100755 docs/General ROS 2/ROS 2 Topics.md create mode 100755 docs/General ROS 2/TurtleSim/Turtlesim Overview.md create mode 100755 docs/Husky 200/Husky 200 Simulator.md rename docs/Husky 200/{Simulator.md => Robot.yaml.md} (50%) delete mode 100755 docs/Husky 200/Visualizing robot.yaml.md rename docs/TurtleBot 4/{Setup.md => Setting Up Turtlebot 4.md} (94%) rename docs/TurtleBot 4/{Turtlebot 4 Action Commands.md => Turtlebot 4 ROS 2 Commands.md} (91%) diff --git a/docs/General ROS 2/Building ROS2 packages.md b/docs/General ROS 2/Building ROS 2 Packages/Building ROS2 packages.md similarity index 86% rename from docs/General ROS 2/Building ROS2 packages.md rename to docs/General ROS 2/Building ROS 2 Packages/Building ROS2 packages.md index fdc87ad..1d47fad 100755 --- a/docs/General ROS 2/Building ROS2 packages.md +++ b/docs/General ROS 2/Building ROS 2 Packages/Building ROS2 packages.md @@ -1,24 +1,7 @@ -# Setup -## Installing VSCode -first install vscode using snap -```bash -sudo snap install code --classic -``` -then add the `ROS` extension from Microsoft. +# Building ROS2 packages +## Setup -## Installing Colcon -To install colcon first run the sudo apt install command. -``` bash -sudo apt install python3-colcon-common-extensions -``` - -then add the colcon autocomplete to the `.bashrc` file. -``` bash -echo 'source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash' >> ~/.bashrc -``` - - -# Setting up the ROS2 Package Workspace +### Setting up the ROS2 Package Workspace first create the folder for the package usual it is called `packagename_ws`where `_ws` stands for then you enter the directory and create another directory called `src` then run the `colcon build` command. ```bash colcon build @@ -29,7 +12,7 @@ echo "source /home/username/package_ws/install/setup.bash" >> ~/.bashrc ``` ## Creating a Python Packages -#### Setting Up +### Setting Up Go to the workspace folder that was created in the last step and open the `src` folder. In this folder run this command. ```bash ros2 pkg create {package_name} --build-type ament_python --dependencies rclpy @@ -37,10 +20,10 @@ ros2 pkg create {package_name} --build-type ament_python --dependencies rclpy add your code in to the folder with the `__init__.py`. This is usually in the folder `src/{package_name}/{package_name}` -#### Programming +### Programming create a python file for your first node. -```python title="my_first_node.py" +```python title="my_first_node.py" linenums="1" #!/usr/bin/env python import rclpy from rclpy.node import Node @@ -76,7 +59,7 @@ it is setup with the name of the ROS2 command first then the equals followed by The final step is building the script and testing it. -#### Building +### Building go the the `{package_name}_ws` folder with the `src` and `install` folder in it. Then run the `colcon build` command. ```bash colcon build @@ -84,7 +67,13 @@ colcon build next run the `source ~/.bashrc` command to reload the workspace source file and the other source files. -#### Simplifying Build (specific to python) +To help improve the build speed we can also use `--packages-select` to only build a specific package. +```bash +colcon build --packages-select {package_name} +``` + + +### Simplifying Build (specific to python) since we are using python and it is interpreted we can simplify the build process when working buy using the symlink command to avoid building. ```bash colcon build --symlink-install @@ -103,7 +92,7 @@ ros2 pkg create {package_name} --build-type ament_cmake --dependencies rclcpp next create a file in `{package_name}/src`and call it `node_name.cpp` -```cpp title="node_name.cpp" +```cpp title="node_name.cpp" linenums="1" #include "rclcpp/rclcpp.hpp" class MyNode : public rclcpp::Node @@ -140,7 +129,7 @@ int main(int argc, char **argv) Next open the program menu on VSCode using `CTRL + SHIFT + P`. Select the `C/C++: Edit Configurations (JSON)`. Make Sure the `c_cpp_properties.json` file has the `"/opt/ros/humble/include/**"` include -```json hl_lines="9" +```json hl_lines="9" linenums="1" { "configurations": [ { diff --git a/docs/General ROS 2/Colcon.md b/docs/General ROS 2/Building ROS 2 Packages/Installing Tools.md similarity index 59% rename from docs/General ROS 2/Colcon.md rename to docs/General ROS 2/Building ROS 2 Packages/Installing Tools.md index 7b6f188..46be273 100755 --- a/docs/General ROS 2/Colcon.md +++ b/docs/General ROS 2/Building ROS 2 Packages/Installing Tools.md @@ -1,4 +1,12 @@ -# Installing +# Installing Tools +## Installing VSCode +first install vscode using snap +```bash +sudo snap install code --classic +``` +then add the `ROS` extension from Microsoft. + +## Installing Colcon To install colcon first run the sudo apt install command. ``` bash sudo apt install python3-colcon-common-extensions @@ -7,4 +15,5 @@ sudo apt install python3-colcon-common-extensions then add the colcon autocomplete to the `.bashrc` file. ``` bash echo 'source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash' >> ~/.bashrc -``` \ No newline at end of file +``` + diff --git a/docs/General ROS 2/Building ROS 2 Packages/Message Types.md b/docs/General ROS 2/Building ROS 2 Packages/Message Types.md new file mode 100755 index 0000000..4fc5c2b --- /dev/null +++ b/docs/General ROS 2/Building ROS 2 Packages/Message Types.md @@ -0,0 +1,28 @@ +# Message Types +## What is a Message Type +In ROS 2 (Robot Operating System 2), a `msg` type refers to a message definition that contains data structures used for communication between nodes. These messages are the building blocks for publishing and subscribing to topics, which enable nodes to exchange information with each other. Think of a message as a container that holds specific types and amounts of data, like a digital package being sent between nodes in a ROS 2 nodes. Each type of message corresponds to a particular set of data fields and their data types (e.g., `int8`, `float32`, `String`). When you define a message, you're specifying the structure of the data that will be sent or received by nodes. This allows for more organized and efficient communication between nodes. +## How to find them +When creating a publisher you have to figure out what data type it is going to publish. To find examples of the different data types in ROS 2 you can run a special command. + +```bash { .annotate } +ros2 interface show example_interfaces/msg/String #(1) +``` + +1. In this case it was the `String` type that I used but it could have been any other type. To get a list use `Tab`before typing `String` for a autocomplete list of options. + +## Including Message Types +Once you have found the message type you will need to make sure that it is imported. This can be pretty easily in both C++ and Python. + +Below you can see that we use the `String` as the message type. This example works for other types as well of messages as well. You can just swap `String` for whatever other data type that is available. +=== "Python" + ```python + from example_interfaces.msg import String + ``` + +=== "C++" + ``` c++ + #include "example_interfaces/msg/string.hpp" + ``` + + + diff --git a/docs/General ROS 2/Building ROS 2 Packages/Publisher.md b/docs/General ROS 2/Building ROS 2 Packages/Publisher.md new file mode 100755 index 0000000..5d868f2 --- /dev/null +++ b/docs/General ROS 2/Building ROS 2 Packages/Publisher.md @@ -0,0 +1,80 @@ +# Publisher +## Sample Code +Here is the code for creating a node that publishes strings to `/robot_news` at 2Hz. + +=== "Python" + ``` python title="robot_news_station.py" linenums="1" + #!/usr/bin/env python + import rclpy + from rclpy.node import Node + # import message type + from example_interfaces.msg import String + + class RobotNewsStationNode(Node): + def __init__(self): + super().__init__("robot_news_station") + + # Create publisher with the proper message type + self.publisher_ = self.create_publisher(String, "robot_news", 10) + # Create timer to triger message at 2Hz + self.timer_ = self.create_timer(0.5, self.publish_news) + self.get_logger().info("Starting the robot news station") + + def publish_news(self): + # Create massage payload + msg = String() + # Add 'Hello' as the data + msg.data = "Hello" + # Publish the data payload + self.publisher_.publish(msg) + + + def main (args=None): + rclpy.init(args=args) + node = RobotNewsStationNode() + rclpy.spin(node) + rclpy.shutdown() + + + if __name__ == '__main__': + main() + ``` + +=== "C++" + ``` python title="robot_news_station.cpp" linenums="1" + #include "rclcpp/rclcpp.hpp" + #include "example_interfaces/msg/string.hpp" + + class RobotNewsStationNode : public rclcpp::Node + { + public: + RobotNewsStationNode() : Node("robot_news_station") + { + publisher_ = this->create_publisher("robot_news", 10); + timer_ = this->create_wall_timer(std::chrono::milliseconds(500), + std::bind(&RobotNewsStationNode::publishNews, this)); + RCLCPP_INFO(this->get_logger(),"Robot News Station has been started."); + } + + private: + void publishNews() + { + auto msg = example_interfaces::msg::String(); + msg.data = std::string("Hi, this is") + robot_name_ + std::string(" from the Robot News Station") ; + publisher_->publish(msg); + } + + std::string robot_name_; + rclcpp::Publisher::SharedPtr publisher_; + rclcpp::TimerBase::SharedPtr timer_; + }; + + int main(int argc, char **argv) + { + rclcpp::init(argc, argv); + auto node = std::make_shared(); + rclcpp::spin(node); + rclcpp::shutdown(); + return 0; + } + ``` diff --git a/docs/General ROS 2/Building ROS 2 Packages/ROS 2 Dependencies.md b/docs/General ROS 2/Building ROS 2 Packages/ROS 2 Dependencies.md new file mode 100755 index 0000000..70fd335 --- /dev/null +++ b/docs/General ROS 2/Building ROS 2 Packages/ROS 2 Dependencies.md @@ -0,0 +1,91 @@ +# ROS 2 Dependencies +## Dependencies +When I comes to adding packages and libraries to ROS 2 you will have to include them in the respective programs but they will also need to be added to the build files as dependencies. Doing this is just a little bit different in python and C++ so I will show both ways. You can import or include any library but for simplicity we will just use the `example_interface` library in this example + +## Python +In python you only have to add the library to the `package.xml` like shown. + +```xml title="package.xml" hl_lines="10-11" linenums="1" + + + + my_py_pkg + 0.0.0 + TODO: Package description + ros-laptop1 + TODO: License declaration + + rclpy + example_interfaces + + ament_copyright + ament_flake8 + ament_pep257 + python3-pytest + + + ament_python + + +``` + +## C++ +In C++ it is a little harder to add libraries to the build files. The first place to add the library is the `package.xml` just like in python. + +```xml title="package.xml" hl_lines="12-13" linenums="1" + + + + my_cpp_pkg + 0.0.0 + TODO: Package description + ros-laptop1 + TODO: License declaration + + ament_cmake + + rclcpp + example_interfaces + + ament_lint_auto + ament_lint_common + + + ament_cmake + + + +``` + +Next you have to add the libraries to multiple places in the `CMakeLists.txt`. +```cmake title="CMakeLists.txt" hl_lines="9-11 17 20" linenums="1" +cmake_minimum_required(VERSION 3.8) +project(my_cpp_pkg) + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) +find_package(rclcpp REQUIRED) +find_package(example_interfaces REQUIRED) + +add_executable(cpp_node src/my_first_node.cpp) +ament_target_dependencies(cpp_node rclcpp) + +add_executable(robot_news_station src/robot_news_station.cpp) +ament_target_dependencies(robot_news_station rclcpp example_interfaces) + +add_executable(smartphone src/smartphone.cpp) +ament_target_dependencies(smartphone rclcpp example_interfaces) + +install(TARGETS + cpp_node + robot_news_station + smartphone + DESTINATION lib/${PROJECT_NAME} +) + +ament_package() +``` \ No newline at end of file diff --git a/docs/General ROS 2/Building ROS 2 Packages/Subscriber.md b/docs/General ROS 2/Building ROS 2 Packages/Subscriber.md new file mode 100755 index 0000000..965f67a --- /dev/null +++ b/docs/General ROS 2/Building ROS 2 Packages/Subscriber.md @@ -0,0 +1,67 @@ +# Subscriber + +## Sample Code +Here is the code for creating a python node that subscribes to `/robot_news` at 2Hz. + +=== "Python" + ``` python title="smartphone.py" linenums="1" + #!/usr/bin/env python + + import rclpy + from rclpy.node import Node + from example_interfaces.msg import String + + class SmartphoneNode(Node): + + def __init__(self): + super().__init__("smartphone") + self.subscriber_ = self.create_subscription(String, 'robot_news', self.callback_robot_news, 10) + self.get_logger().info("Smartphone has been starte.") + + def callback_robot_news(self, msg): + self.get_logger().info(msg.data) + + def main (args=None): + rclpy.init(args=args) + node = SmartphoneNode() + rclpy.spin(node) + rclpy.shutdown() + + + if __name__ == '__main__': + main() + ``` +=== "C++" + ``` python title="smartphone.cpp" linenums="1" + #include "rclcpp/rclcpp.hpp" + #include "example_interfaces/msg/string.hpp" + + class SmartphoneNode : public rclcpp::Node + { + public: + SmartphoneNode() : Node("smartphone") + { + subscriber_ = this->create_subscription( + "robot_news", 10, + std::bind(&SmartphoneNode::callbackRobotNews, this, std::placeholders::_1)); + RCLCPP_INFO(this->get_logger(), "Smartphone has been started."); + } + + private: + void callbackRobotNews(const example_interfaces::msg::String::SharedPtr msg) + { + RCLCPP_INFO(this->get_logger(), "%s", msg->data.c_str()); + } + rclcpp::Subscription::SharedPtr subscriber_; + }; + + + int main(int argc, char **argv) + { + rclcpp::init(argc, argv); + auto node = std::make_shared(); + rclcpp::spin(node); + rclcpp::shutdown(); + return 0; + } + ``` \ No newline at end of file diff --git a/docs/General ROS 2/Debugging.md b/docs/General ROS 2/Debugging.md new file mode 100755 index 0000000..0af1806 --- /dev/null +++ b/docs/General ROS 2/Debugging.md @@ -0,0 +1,38 @@ +# Debugging +## RQT and RQT_Graph +RQT is a GUI tool to debug your ROS 2 environment and nodes. It helps visualize what is going on in the different ROS 2 programs and how they are linked to gather. It also helps us see where bugs might occur and how they might be solved and prevented. + +To launch RQT we can just simply run `rqt` in our terminal. + +```bash +rqt +``` + +RQT is made up of a bunch of different plugins. One of the most useful plugins is the `node graph` plugin found under `Plugins>Introspection>Node Graph`. This tool allows us to visualize the layout of our nodes and how they are communicating + +You can also start rqt with the graph plugin enabled with one of the following two commands +```bash +# Method 1 +ros2 run rqt_graph rqt_graph + +# Method 2 +rqt_graph +``` + +## Debugging ROS 2 Topics +To get the frequency of how fast a topic is being published the run this command: +```bash +ros2 topic hz /topic_to_see +``` + +To get information on who is publishing and listening to a topic run this command: +```bash +ros2 topic info /topic_to_see +``` + +To get the bandwidth of a topic can can run this command: +```bash +ros2 topic bw /topic_to_see +``` + + diff --git a/docs/General ROS 2/Debuging.md b/docs/General ROS 2/Debuging.md deleted file mode 100755 index f148c60..0000000 --- a/docs/General ROS 2/Debuging.md +++ /dev/null @@ -1,8 +0,0 @@ - -Get a map of the nodes on the ros network -```bash -ros2 run rqt_graph rqt_graph -``` - - - diff --git a/docs/General ROS 2/Micro ROS/Micro ROS Bridge.md b/docs/General ROS 2/Micro ROS/Micro ROS Bridge.md new file mode 100755 index 0000000..1082b97 --- /dev/null +++ b/docs/General ROS 2/Micro ROS/Micro ROS Bridge.md @@ -0,0 +1,59 @@ +# Micro ROS Bridge +## Serial Bridge + +=== "docker run" + ```bash + docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:$ROS_DISTRO serial --dev [YOUR BOARD PORT] -v6 + ``` +=== "docker compose" + ```yaml title="docker-compose.yaml" + services: +  micro_ros_agent: +    image: microros/micro-ros-agent:humble +    command: serial --dev [YOUR BOARD PORT] -v6 +    network_mode: "host" +    privileged: true +    volumes: +      - /dev:/dev +      - /dev/shm:/dev/shm + ``` + + +## TCP Bridge + +=== "docker run" + ```bash + docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:$ROS_DISTRO tcp4 --port 8888 -v6 + ``` +=== "docker compose" + ```yaml title="docker-compose.yaml" + services: +  micro_ros_agent: +    image: microros/micro-ros-agent:humble +    command: tcp4 --port 8888 -v6 +    network_mode: "host" +    privileged: true +    volumes: +      - /dev:/dev +      - /dev/shm:/dev/shm + ``` + + +## UDP Bridge + +=== "docker run" + ```bash + docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:$ROS_DISTRO udp4 --port 8888 -v6 + ``` +=== "docker compose" + ```yaml title="docker-compose.yaml" + services: +  micro_ros_agent: +    image: microros/micro-ros-agent:humble +    command: udp4 --port 8888 -v6 +    network_mode: "host" +    privileged: true +    volumes: +      - /dev:/dev +      - /dev/shm:/dev/shm + ``` diff --git a/docs/General ROS 2/ROS 2 Nodes.md b/docs/General ROS 2/ROS 2 Nodes.md index 54c77f8..c53628f 100755 --- a/docs/General ROS 2/ROS 2 Nodes.md +++ b/docs/General ROS 2/ROS 2 Nodes.md @@ -1,3 +1,25 @@ -# Nodes +dd# ROS 2 Nodes +## Node Layout Nodes are the different ROS topics. in the below picture the nodes are in blue. -![[ros2_nodes.png|900]] \ No newline at end of file +![[ros2_nodes.png|900]] + +## Getting Node info +To get information about a ROS 2 node you can use the ros2 cli to explore the nodes. + +The command `ros2 node list` shows a list of all the nodes avalible. It can be handy to make sure the nodes are all discovered and working properly. +```bash +ros2 node list +``` + +Their is also a ROS 2 command for getting information about an individual node. +```bash +ros2 node info {/node_name} +``` + +## Renaming a Node at Runtime +Renaming a node at runtime is useful when their are two ROS packages with the same node name. This method will allow you to change the name of the node so that both packages can run with out interference. + +The command to rename a node is: +```bash +ros2 run {package_name} {node_name} --ros-args -r __node:{new_name} +``` \ No newline at end of file diff --git a/docs/General ROS 2/ROS 2 Topics.md b/docs/General ROS 2/ROS 2 Topics.md new file mode 100755 index 0000000..5886e55 --- /dev/null +++ b/docs/General ROS 2/ROS 2 Topics.md @@ -0,0 +1,29 @@ +# ROS 2 Topics +## ROS 2 Topic Overview +In ROS 2, **topics** are the communication channels used for **publish-subscribe messaging**. They allow nodes to exchange data asynchronously without direct connections. Here's how it works: + +1. **Publishers**: Nodes that send messages to a topic. For example, a sensor node might publish temperature readings to a `/temperature` topic. +2. **Subscribers**: Nodes that receive messages from a topic. For instance, a logging node might subscribe to the `/temperature` topic to record data. +3. **Messages**: The data structure exchanged over topics. These are predefined formats (like integers, strings, arrays, etc.) specified in `.msg` files. + + +## Key Features: + +- **Decoupled Communication**: Publishers and subscribers do not need to know about each other. +- **Topic Names**: Identified by strings (e.g., `/robot/speed`). +- **Quality of Service (QoS)**: Configurations like reliability and durability to ensure robust communication in various environments. +- **Tools**: + - Use `ros2 topic list` to view active topics. + - Use `ros2 topic echo` to see the data published on a topic. + - Use `ros2 topic pub` to manually publish data for testing. + +This structure supports scalable and modular robotic applications. + + +## Renaming a Topic at Runtime +Renaming a node at runtime is useful when their are two ROS packages with the same node name. This method will allow you to change the name of the node so that both packages can run with out interference. + +The command to rename a topic is: +```bash +ros2 run {package_name} {node_name} --ros-args -r __{topic_old_name}:{topic_new_name} +``` \ No newline at end of file diff --git a/docs/General ROS 2/TurtleSim/Turtlesim Overview.md b/docs/General ROS 2/TurtleSim/Turtlesim Overview.md new file mode 100755 index 0000000..9234416 --- /dev/null +++ b/docs/General ROS 2/TurtleSim/Turtlesim Overview.md @@ -0,0 +1,18 @@ +# Turtlesim Overview +## What is Turtlesim +Turtlesim is a simple python node that helps you learn ROS 2 with simple examples and tutorials. + +## Installation +To install the ROS 2 Turtlesim you will need run `sudo apt install ros-humble-turtlesim`. +```bash +sudo apt install ros-humble-turtlesim +``` + + +## Basic Features of Turtlesim +The Turtlesim package comes with two simple nodes a `turtlesim_node` and a `turtle_teleop_key` node. The `turtlesim_node` launches a window that has a little 2D turtle in it. The `turtle_teleop_key` node allows you to use the arrow keys to move and steer the little turtle around its 2D world. These can be launched using their respective commands. + +```bash +ros2 turtlesim turtlesim_node +ros2 turtlesim turtle_teleop_key +``` diff --git a/docs/Husky 200/Husky 200 Simulator.md b/docs/Husky 200/Husky 200 Simulator.md new file mode 100755 index 0000000..43f6bc9 --- /dev/null +++ b/docs/Husky 200/Husky 200 Simulator.md @@ -0,0 +1,19 @@ +# Husky 200 Simulator +## Launching Simulator +To launch Gazbo with the Husky 200 robot in it run the following command. +```bash +ros2 launch clearpath_gz simulation.launch.py setup_path:=$HOME/clearpath +``` + +Launch MoveIt! by passing the same robot setup directory and setting the simulation flag. +``` +ros2 launch clearpath_manipulators moveit.launch.py setup_path:=$HOME/clearpath use_sim_time:=true +``` + +Launch RViz by passing the robot's namespace and enabling the simulation flag. +``` +ros2 launch clearpath_viz view_moveit.launch.py namespace:=a200_0000 use_sim_time:=True +``` + + + diff --git a/docs/Husky 200/Simulator.md b/docs/Husky 200/Robot.yaml.md similarity index 50% rename from docs/Husky 200/Simulator.md rename to docs/Husky 200/Robot.yaml.md index 85d6d19..6115f19 100755 --- a/docs/Husky 200/Simulator.md +++ b/docs/Husky 200/Robot.yaml.md @@ -1,12 +1,17 @@ -launching simulator +# robot.yaml +The `robot.yaml` file has all the configurations for the Husky 200 robot and the other clearpathrobotics robots. +## Visualizing +To see the `robot.yaml` file run the following command. It will show you how the robot looks and where all the sensors are placed. It comes in hand for not only confirming that everything is on the robot in the right place but that their is also no errors in the robot.yaml file. + ```bash -ros2 launch clearpath_gz simulation.launch.py setup_path:=$HOME/clearpath +ros2 launch clearpath_viz view_model.launch.py setup_path:=/home/brickman/clearpath/ ``` -## Using Manipulator -robot.yaml -```yaml +## Sample file +Below is a sample of the robot.yaml file. + +```yaml title="robot.yaml" linenums="1" serial_number: a200-0000 version: 0 system: @@ -36,21 +41,3 @@ manipulators: gripper: model: kinova_2f_lite ``` - -Launch the simulation -``` -ros2 launch clearpath_gz simulation.launch.py setup_path:=$HOME/clearpath -``` - -Launch MoveIt! by passing the same robot setup directory and setting the simulation flag. -``` -ros2 launch clearpath_manipulators moveit.launch.py setup_path:=$HOME/clearpath use_sim_time:=true -``` - -Launch RViz by passing the robot's namespace and enabling the simulation flag. -``` -ros2 launch clearpath_viz view_moveit.launch.py namespace:=a200_0000 use_sim_time:=True -``` - - - diff --git a/docs/Husky 200/Visualizing robot.yaml.md b/docs/Husky 200/Visualizing robot.yaml.md deleted file mode 100755 index 0d1c56d..0000000 --- a/docs/Husky 200/Visualizing robot.yaml.md +++ /dev/null @@ -1,3 +0,0 @@ -```bash -ros2 launch clearpath_viz view_model.launch.py setup_path:=/home/brickman/clearpath/ -``` diff --git a/docs/TurtleBot 4/Oak D Pro Camera.md b/docs/TurtleBot 4/Oak D Pro Camera.md index 1f0ccb7..8358a20 100755 --- a/docs/TurtleBot 4/Oak D Pro Camera.md +++ b/docs/TurtleBot 4/Oak D Pro Camera.md @@ -1 +1,3 @@ +# Oak D Pro Camera +## Information and Resources The Oak d Pro Camera is an 3d depth camera with integrated NPU for advance AI processing. It is equipped with three cameras two gray scale for the right and left stereo camera and on center camera for color and AI inference. It comes with yolo-v6, yolo-v8, face detector, and an model that detects your gender and age. For more information on how to use it go to [docs.luxonis.com](https://docs.luxonis.com/). \ No newline at end of file diff --git a/docs/TurtleBot 4/SLAM and Navigation.md b/docs/TurtleBot 4/SLAM and Navigation.md index 8a9a766..1251aeb 100755 --- a/docs/TurtleBot 4/SLAM and Navigation.md +++ b/docs/TurtleBot 4/SLAM and Navigation.md @@ -1,4 +1,5 @@ -# SLAM +# SLAM and Navigation +## SLAM ### Troubleshooting #### Date and Time off one of the major problems with the Turtlebot 4 and communication is the time. Make sure you use the `date` command and check what time it is. If the time is off use `rasp-config` to set the correct timezone. The standard Turtlebot 4 image does not have rasp-config install so you will probably have to install it with `sudo apt install rasp-config`. @@ -20,7 +21,7 @@ Once this command is running then you should be able to drive the robot like nor ### Launching the SLAM command Here is the `slam.yaml` config file. You can change the resolution by changing the resolution parameter, by default it is 0.05 but i have had great success when running synchronous SLAM with values as low as 0.01. -```yaml title="slam.yaml" +```yaml title="slam.yaml" linenums="1" slam_toolbox: ros__parameters: @@ -104,7 +105,7 @@ ros2 run nav2_map_server map_saver_cli -f "map_name" ``` -#### Navigation +## Navigation To launch the navigation program on the Turtlebot 4 run the following commands. One per terminal window making sure to execute them on the Remote PC. ```bash # Terminal Window 1 diff --git a/docs/TurtleBot 4/Setup.md b/docs/TurtleBot 4/Setting Up Turtlebot 4.md similarity index 94% rename from docs/TurtleBot 4/Setup.md rename to docs/TurtleBot 4/Setting Up Turtlebot 4.md index 64fdc6e..78708c4 100755 --- a/docs/TurtleBot 4/Setup.md +++ b/docs/TurtleBot 4/Setting Up Turtlebot 4.md @@ -1,6 +1,8 @@ +# Setting Up Turtlebot 4 +## Resources Follow these [steps](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debs.html)on the ROS 2 Documentation Page in install ROS2 on your Remote PC, laptop. Then follow these [steps](https://turtlebot.github.io/turtlebot4-user-manual/setup/basic.html) in the official Turtlebot 4 documentation to install all the Turtlebot 4 programs on your Remote PC, laptop. -###### Quick Tip +## Quick Tip add the `source /opt/ros/humble/setup.bash` command to the `.bashrc` file so you do not have to source it everytime you open a new terminal window ```bash echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc diff --git a/docs/TurtleBot 4/Turtlebot 4 Action Commands.md b/docs/TurtleBot 4/Turtlebot 4 ROS 2 Commands.md similarity index 91% rename from docs/TurtleBot 4/Turtlebot 4 Action Commands.md rename to docs/TurtleBot 4/Turtlebot 4 ROS 2 Commands.md index 4d0e9b5..b4ba6e3 100755 --- a/docs/TurtleBot 4/Turtlebot 4 Action Commands.md +++ b/docs/TurtleBot 4/Turtlebot 4 ROS 2 Commands.md @@ -1,3 +1,4 @@ +# Turtlebot 4 ROS 2 Commands ## Undock This command undocks the Turtlebot 4 from the charging station. ```bash diff --git a/docs/TurtleBot 4/Updating ROS on Turtlebot 4.md b/docs/TurtleBot 4/Updating ROS on Turtlebot 4.md index 520f548..bda2a92 100755 --- a/docs/TurtleBot 4/Updating ROS on Turtlebot 4.md +++ b/docs/TurtleBot 4/Updating ROS on Turtlebot 4.md @@ -1,3 +1,4 @@ +# Updating ROS on Turtlebot 4 ## Create 3 Firmware To install he latest version of the Create 3 firmware go to the [Create 3 firmware Page](https://iroboteducation.github.io/create3_docs/releases/overview/). Then download the latest firmware and navigate to the Create 3 Update Page. Then select the choose file button and locate the `Create3-*.*.*.swu`file on your computer. Finally before flashing make sure the Create 3 is on the charging dock. Once it is on the dock click flash button and wait patently for the robot to flash and then reboot. DO NOT SHUT DOWN OR REMOVE FROM CHARGER. You will know it is done when the robot makes is happy beep. diff --git a/docs/TurtleBot 4/Viewing Turtlebot 4 Sensor Data.md b/docs/TurtleBot 4/Viewing Turtlebot 4 Sensor Data.md index 8fade8d..f202031 100755 --- a/docs/TurtleBot 4/Viewing Turtlebot 4 Sensor Data.md +++ b/docs/TurtleBot 4/Viewing Turtlebot 4 Sensor Data.md @@ -1,3 +1,4 @@ +# Viewing Turtlebot 4 Sensor Data Viewing the Turtlebot 4 sensor data is really easy with Rviz. to view it run the Rviz view model command. ```bash diff --git a/mkdocs.yml b/mkdocs.yml index ab825e0..f48d621 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -52,6 +52,8 @@ markdown_extensions: - footnotes - pymdownx.details - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true - pymdownx.mark - attr_list - pymdownx.emoji: