Skip to content

Commit

Permalink
file:修订位置
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsu-Akatsuki committed Jul 25, 2023
1 parent ef0c236 commit 2ea34cc
Show file tree
Hide file tree
Showing 29 changed files with 73 additions and 67 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 16 additions & 9 deletions docs/Service.md → docs/Beginner/Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ service = rospy.ServiceProxy('服务名', 服务类型)

# 服务端
rospy.Service('服务名', 服务类型, 回调函数)
def self.onCallback(self, req):
# TODO


def self.


onCallback(self, req):
# TODO
```

### ROS2
Expand Down Expand Up @@ -120,11 +125,11 @@ while not self.cli.wait_for_service(timeout_sec=1.0):

## Callback

| | ROS1 | ROS2 |
| :----: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| 返回值 | `bool` | `void` |
| 形参 | 引用(无 const,无指针) | const + 智能指针 |
| 示例 | bool on_clear_route(<br/> ClearRoute::Service::Request &req,<br/> ClearRoute::Service::Response &res); | void on_clear_route(<br/> const ClearRoute::Service::Request::SharedPtr req,<br/> const ClearRoute::Service::Response::SharedPtr res); |
|| ROS1 | ROS2 |
|:---:|:----------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------:|
| 返回值 | `bool` | `void` |
| 形参 | 引用(无 const,无指针) | const + 智能指针 |
| 示例 | bool on_clear_route(<br/> ClearRoute::Service::Request &req,<br/> ClearRoute::Service::Response &res); | void on_clear_route(<br/> const ClearRoute::Service::Request::SharedPtr req,<br/> const ClearRoute::Service::Response::SharedPtr res); |

### ROS1

Expand Down Expand Up @@ -154,9 +159,10 @@ rclcpp::Service<包名::srv::服务类型>::SharedPtr service =
- Python

```python
self.srv = self.create_service(<服务类型>, <服务名>, self.callback)
self.srv = self.create_service( < 服务类型 >, < 服务名 >, self.callback)

def callback(self, request, response):
return response
return response
```

## Call
Expand All @@ -181,6 +187,7 @@ else {
```ad-attention
`call`函数只能接受左值
```

### ROS2

C++中`ROS1`的服务是同步的,而`ROS2`的则为异步
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/DDS.md → docs/Intermediate/DDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ $ export ROS_LOCALHOST_ONLY=1
ROS2 下现已支持的 DDS
</summary>

| Product name | License | RMW implementation | Status |
| :----------------------------------------------------------: | :-------------------------: | -------------------- | :----------------------------------------------------------: |
| [eProsima Fast DDS](https://github.com/ros2/rmw_fastrtps) | Apache 2 | `rmw_fastrtps_cpp` | Full support. Default RMW. Packaged with binary releases. |
| [Eclipse Cyclone DDS](https://github.com/ros2/rmw_cyclonedds) | Eclipse Public License v2.0 | `rmw_cyclonedds_cpp` | Full support. Packaged with binary releases. |
| [RTI Connext DDS](https://github.com/ros2/rmw_connextdds) | commercial, research | `rmw_connextdds` | Full support. Support included in binaries, but Connext installed separately. |
| Product name | License | RMW implementation | Status |
|:---------------------------------------------------------------:|:---------------------------:|----------------------|:---------------------------------------------------------------------------------------:|
| [eProsima Fast DDS](https://github.com/ros2/rmw_fastrtps) | Apache 2 | `rmw_fastrtps_cpp` | Full support. Default RMW. Packaged with binary releases. |
| [Eclipse Cyclone DDS](https://github.com/ros2/rmw_cyclonedds) | Eclipse Public License v2.0 | `rmw_cyclonedds_cpp` | Full support. Packaged with binary releases. |
| [RTI Connext DDS](https://github.com/ros2/rmw_connextdds) | commercial, research | `rmw_connextdds` | Full support. Support included in binaries, but Connext installed separately. |
| [GurumNetworks Gurum DDS](https://github.com/ros2/rmw_gurumdds) | commercial | `rmw_gurumdds_cpp` | Community support. Support included in binaries, but Gurum**DDS** installed separately. |

</details>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 24 additions & 27 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,39 @@

### Beginner

- [Build Tool](Build%20Tool.md)
- [CMake and Package](CMake%20and%20Package.md)
- [Exectuor and Callback](Exectuor%20and%20Callback.md)
- [Header and Module](Header%20and%20Module.md)
- [Install](Install.md)
- [Interface](Interface.md)
- [Launch](Launch.md)
- [Logger](Logger.md)
- [Network](Network.md)
- [Node and Component](Node%20and%20Component.md)
- [Paramter Server](Paramter%20Server.md)
- [Plugins](Plugins.md)
- [Publisher and Subscriber](Publisher%20and%20Subscriber.md)
- [Rosbag](Rosbag.md)
- [RosCLI](RosCLI.md)
- [Service](Service.md)
- [TF](TF.md)
- [Time](Time.md)
- [Build Tool](Beginner/Build%20Tool.md)
- [CMake and Package](Beginner/CMake%20and%20Package.md)
- [Exectuor and Callback](Beginner/Exectuor%20and%20Callback.md)
- [Header and Module](Beginner/Header%20and%20Module.md)
- [Install](Beginner/Install.md)
- [Interface](Beginner/Interface.md)
- [Launch](Beginner/Launch.md)
- [Logger](Beginner/Logger.md)
- [Network](Beginner/Network.md)
- [Node and Component](Beginner/Node%20and%20Component.md)
- [Paramter Server](Beginner/Paramter%20Server.md)
- [Publisher and Subscriber](Beginner/Publisher%20and%20Subscriber.md)
- [rosbag](Beginner/rosbag.md)
- [Service](Beginner/Service.md)
- [TF](Beginner/TF.md)
- [Time](Beginner/Time.md)

### Intermediate

- [DDS](DDS.md)
- [Deployment](Deployment.md)
- [DDS](Intermediate/DDS.md)
- [Deployment](Intermediate/Deployment.md)
- [Assertion and Exception](Assertion%20and%20Exception.md)
- [Plugins](Plugins.md)
- [Plugins](Intermediate/Plugins.md)

### Software and Tools

- [Gazebo](Gazebo.md)
- [RViz](RViz.md)
- [Tool](Tool.md)
- [Gazebo](Software%20and%20Tools/Gazebo.md)
- [RViz](Software%20and%20Tools/RViz.md)
- [Tool](Software%20and%20Tools/Tool.md)

**Others**
### Others

- [Code Style](Code%20Style.md)
- [Deployment](Deployment.md)
- [Code Style](Others/Code%20Style.md)

## FAQ

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- [Home](README.md)
- :octocat: [GitHub](https://github.com/Natsu-Akatsuki/ros_cookbook)
- :link: Others
- [AMBook](https://natsu-akatsuki.github.io/ambook/#/ '工具文档')
- [AMBook](https://natsu-akatsuki.github.io/ambook/#/ '工具文档')
- [ROS2](https://docs.ros.org/en/iron/index.html)
49 changes: 25 additions & 24 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
- [Home](/)

- Beginner
- [Build Tool](Build%20Tool.md)
- [CMake and Package](CMake%20and%20Package.md)
- [Exectuor and Callback](Exectuor%20and%20Callback.md)
- [Header and Module](Header%20and%20Module.md)
- [Install](Install.md)
- [Interface](Interface.md)
- [Launch](Launch.md)
- [Logger](Logger.md)
- [Network](Network.md)
- [Node and Component](Node%20and%20Component.md)
- [Paramter Server](Paramter%20Server.md)
- [Plugins](Plugins.md)
- [Publisher and Subscriber](Publisher%20and%20Subscriber.md)
- [Rosbag](Rosbag.md)
- [RosCLI](RosCLI.md)
- [Service](Service.md)
- [TF](TF.md)
- [Time](Time.md)
- [Build Tool](Beginner/Build%20Tool.md)
- [CMake and Package](Beginner/CMake%20and%20Package.md)
- [Exectuor and Callback](Beginner/Exectuor%20and%20Callback.md)
- [Header and Module](Beginner/Header%20and%20Module.md)
- [Install](Beginner/Install.md)
- [Interface](Beginner/Interface.md)
- [Launch](Beginner/Launch.md)
- [Logger](Beginner/Logger.md)
- [Network](Beginner/Network.md)
- [Node and Component](Beginner/Node%20and%20Component.md)
- [Paramter Server](Beginner/Paramter%20Server.md)
- [Publisher and Subscriber](Beginner/Publisher%20and%20Subscriber.md)
- [rosbag](Beginner/rosbag.md)
- [Service](Beginner/Service.md)
- [TF](Beginner/TF.md)
- [Time](Beginner/Time.md)

- Intermediate
- [DDS](DDS.md)
- [Deployment](Deployment.md)
- [Assertion and Exception](Assertion%20and%20Exception.md)
- [Plugins](Plugins.md)
- [DDS](Intermediate/DDS.md)
- [Deployment](Intermediate/Deployment.md)
- [Plugins](Intermediate/Plugins.md)

- Software and Tools
- [Gazebo](Gazebo.md)
- [RViz](RViz.md)
- [Tool](Tool.md)
- [Gazebo](Software%20and%20Tools/Gazebo.md)
- [RViz](Software%20and%20Tools/RViz.md)
- [Tool](Software%20and%20Tools/Tool.md)

- Others
- [Code Style](Others/Code%20Style.md)
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
crossChapterText: true,
},
plugins: [
EditOnGithubPlugin.create("https://github.com/Natsu-Akatsuki/ros_cookbook/tree/main/docs", "", "Edit on GitHub")
EditOnGithubPlugin.create("https://github.com/Natsu-Akatsuki/ros_cookbook/tree/main/docs/", "", "Edit on GitHub")
],
}

Expand Down

0 comments on commit 2ea34cc

Please sign in to comment.