Skip to content

Commit 23155df

Browse files
committed
rename directory and pass CI without ROS2 install
1 parent f3ef623 commit 23155df

15 files changed

+82
-50
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name = "RobotOperatingClient"
1+
name = "ROS2"
22
uuid = "493365b4-7e18-460b-8b90-ec3e7f80d3eb"
33
authors = ["Michi-Tsubaki <michi.tsubaki.tech@gmail.com>"]
4-
version = "0.1.3"
4+
version = "0.1.4"
55

66
[deps]
77
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# RobotOperatingClient.jl
1+
# ROS2.jl
22

3-
RobotOperatingClient (ROS2 on Julia) is a Julia wrapper for ROS2's Python client library (rclpy). It provides a Julia-friendly interface for ROS2 functionality while leveraging the robust features of rclpy.
3+
ROS2 (ROS2 on Julia) is a Julia wrapper for ROS2's Python client library (rclpy). It provides a Julia-friendly interface for ROS2 functionality while leveraging the robust features of rclpy.
44

55
[日本語のREADMEはこちら](#rojjl-1)
66

@@ -31,7 +31,7 @@ RobotOperatingClient (ROS2 on Julia) is a Julia wrapper for ROS2's Python client
3131

3232
### Version Compatibility
3333

34-
| RobotOperatingClient.jl Version | ROS2 Version | Julia Version | Python Version |
34+
| ROS2.jl Version | ROS2 Version | Julia Version | Python Version |
3535
|----------------|--------------|---------------|----------------|
3636
| 0.1.x | Jazzy | 1.10+ | 3.12 |
3737

@@ -42,18 +42,18 @@ RobotOperatingClient (ROS2 on Julia) is a Julia wrapper for ROS2's Python client
4242
source /opt/ros/$ROS_DISTRO/setup.bash
4343
```
4444

45-
2. Install RobotOperatingClient.jl:
45+
2. Install ROS2.jl:
4646
```julia
4747
using Pkg
48-
Pkg.add(url="https://github.com/your-username/RobotOperatingClient.jl")
48+
Pkg.add(url="https://github.com/your-username/ROS2.jl")
4949
```
5050

5151
## Usage
5252

5353
### Basic Example
5454

5555
```julia
56-
using RobotOperatingClient
56+
using ROS2
5757

5858
# Create a node
5959
node = ROSNode("example_node")
@@ -100,21 +100,21 @@ Check the `examples/` directory for more detailed examples:
100100

101101
## Notes
102102

103-
1. Always source ROS2 environment before using RobotOperatingClient:
103+
1. Always source ROS2 environment before using ROS2:
104104
```bash
105105
source /opt/ros/$ROS_DISTRO/setup.bash
106106
```
107107

108-
2. When using RobotOperatingClient in a ROS2 package:
109-
- Add RobotOperatingClient as a dependency in your package.xml
108+
2. When using ROS2 in a ROS2 package:
109+
- Add ROS2 as a dependency in your package.xml
110110
- Configure your CMakeLists.txt to include Julia files
111111
- Run `colcon build` to build your package
112112

113-
3. RobotOperatingClient requires Python with rclpy installed and properly configured
113+
3. ROS2 requires Python with rclpy installed and properly configured
114114

115115
## Contributing
116116

117-
We warmly welcome contributions to RobotOperatingClient.jl! Whether it's bug fixes, new features, documentation improvements, or example code, your help is appreciated.
117+
We warmly welcome contributions to ROS2.jl! Whether it's bug fixes, new features, documentation improvements, or example code, your help is appreciated.
118118

119119
### Ways to Contribute
120120

@@ -152,8 +152,8 @@ We warmly welcome contributions to RobotOperatingClient.jl! Whether it's bug fix
152152

153153
```bash
154154
# Clone the repository
155-
git clone https://github.com/your-username/RobotOperatingClient.jl
156-
cd RobotOperatingClient.jl
155+
git clone https://github.com/your-username/ROS2.jl
156+
cd ROS2.jl
157157

158158
# Add the package in development mode
159159
julia -e 'using Pkg; Pkg.develop(path=".")'
@@ -179,9 +179,9 @@ This project is licensed under the MIT License - see the LICENSE file for detail
179179

180180
---
181181

182-
# RobotOperatingClient.jl
182+
# ROS2.jl
183183

184-
RobotOperatingClient (ROS2 on Julia)は、ROS2のPythonクライアントライブラリ(rclpy)のJuliaラッパーです。rclpyの堅牢な機能を活用しながら、JuliaフレンドリーなインターフェースでROS2の機能を提供します。
184+
ROS2 (ROS2 on Julia)は、ROS2のPythonクライアントライブラリ(rclpy)のJuliaラッパーです。rclpyの堅牢な機能を活用しながら、JuliaフレンドリーなインターフェースでROS2の機能を提供します。
185185

186186
## 機能
187187

@@ -210,7 +210,7 @@ RobotOperatingClient (ROS2 on Julia)は、ROS2のPythonクライアントライ
210210

211211
### バージョン互換性
212212

213-
| RobotOperatingClient.jl バージョン | ROS2 バージョン | Julia バージョン | Python バージョン |
213+
| ROS2.jl バージョン | ROS2 バージョン | Julia バージョン | Python バージョン |
214214
|------------------|----------------|-----------------|------------------|
215215
| 0.1.x | Jazzy | 1.10以上 | 3.12 |
216216

@@ -221,18 +221,18 @@ RobotOperatingClient (ROS2 on Julia)は、ROS2のPythonクライアントライ
221221
source /opt/ros/$ROS_DISTRO/setup.bash
222222
```
223223

224-
2. RobotOperatingClient.jlのインストール:
224+
2. ROS2.jlのインストール:
225225
```julia
226226
using Pkg
227-
Pkg.add(url="https://github.com/your-username/RobotOperatingClient.jl")
227+
Pkg.add(url="https://github.com/your-username/ROS2.jl")
228228
```
229229

230230
## 使用方法
231231

232232
### 基本例
233233

234234
```julia
235-
using RobotOperatingClient
235+
using ROS2
236236

237237
# ノードの作成
238238
node = ROSNode("example_node")
@@ -279,21 +279,21 @@ end
279279

280280
## 注意点
281281

282-
1. RobotOperatingClientを使用する前に必ずROS2環境を読み込んでください
282+
1. ROS2を使用する前に必ずROS2環境を読み込んでください
283283
```bash
284284
source /opt/ros/$ROS_DISTRO/setup.bash
285285
```
286286

287-
2. ROS2パッケージでRobotOperatingClientを使用する場合
288-
- package.xmlにRobotOperatingClientを依存関係として追加
287+
2. ROS2パッケージでROS2を使用する場合
288+
- package.xmlにROS2を依存関係として追加
289289
- CMakeLists.txtでJuliaファイルを含むように設定
290290
- `colcon build`でパッケージをビルド
291291

292-
3. RobotOperatingClientには、rclpyがインストールされ、適切に設定されたPythonが必要です
292+
3. ROS2には、rclpyがインストールされ、適切に設定されたPythonが必要です
293293

294294
## 貢献について
295295

296-
RobotOperatingClient.jlへの貢献を歓迎します!バグ修正、新機能、ドキュメントの改善、サンプルコードなど、あらゆる形の協力を感謝します。
296+
ROS2.jlへの貢献を歓迎します!バグ修正、新機能、ドキュメントの改善、サンプルコードなど、あらゆる形の協力を感謝します。
297297

298298
### 貢献の方法
299299

@@ -331,8 +331,8 @@ RobotOperatingClient.jlへの貢献を歓迎します!バグ修正、新機能
331331

332332
```bash
333333
# リポジトリをクローン
334-
git clone https://github.com/your-username/RobotOperatingClient.jl
335-
cd RobotOperatingClient.jl
334+
git clone https://github.com/your-username/ROS2.jl
335+
cd ROS2.jl
336336

337337
# パッケージを開発モードで追加
338338
julia -e 'using Pkg; Pkg.develop(path=".")'

examples/example_service_client.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env julia
22
# example_service_client.jl
33

4-
using RobotOperatingClient
4+
using ROS2
55

66
function main()
77
println("Creating node...")

examples/example_service_server.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env julia
22
# example_service_server.jl
3-
using RobotOperatingClient
3+
using ROS2
44
using PyCall
55

66
function add_service_callback(request, response)

examples/pose_publisher.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env julia
22

33
# pose_publisher.jl
4-
using RobotOperatingClient
4+
using ROS2
55

66
function main()
77
# Creating node

examples/pose_subscriber.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env julia
22

33
# pose_subscriber.jl
4-
using RobotOperatingClient
4+
using ROS2
55

66
function int_callback(msg)
77
println("Received counter: $(msg.data)")

examples/simple_pub_sub.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env julia
22

33
# simple_pub_sub.jl
4-
using RobotOperatingClient
4+
using ROS2
55

66
function main()
77
# Creating node

examples/simple_publisher.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# simple_publisher.jl
33
# description: sample publishing code
44

5-
using RobotOperatingClient
5+
using ROS2
66

77
function main()
88
# Creating node

examples/simple_subscriber.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env julia
22
# simple_subscriber.jl
33
# description : sample subscription code
4-
using RobotOperatingClient
4+
using ROS2
55

66
function callback(msg)
77
println("Subscribed: ", msg.data)
Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
1-
module RobotOperatingClient
2-
1+
module ROS2
32
using PyCall
43

4+
const rclpy = PyNULL()
5+
const rclpy_node = PyNULL()
6+
7+
function __init__()
8+
try
9+
# Check ROS2 environment
10+
if !haskey(ENV, "AMENT_PREFIX_PATH")
11+
error("ROS2 environment not sourced. Please run 'source /opt/ros/\$ROS_DISTRO/setup.bash' first")
12+
end
13+
14+
# Get Python executable path
15+
python_path = PyCall.python
16+
17+
# Add ROS2 Python path
18+
ros_python_path = "/opt/ros/jazzy/lib/python3.12/site-packages"
19+
py"""
20+
import sys
21+
ros_path = $ros_python_path
22+
if ros_path not in sys.path:
23+
sys.path.insert(0, ros_path)
24+
"""
25+
26+
# Import rclpy
27+
copy!(rclpy, pyimport("rclpy"))
28+
copy!(rclpy_node, pyimport("rclpy.node"))
29+
catch e
30+
println("Error during ROS2 initialization: ", e)
31+
println("Exception type: ", typeof(e))
32+
println("Stacktrace: ", stacktrace())
33+
rethrow(e)
34+
end
35+
end
36+
537
# Include submodules
638
include("core.jl")
739
include("pubsub.jl")

0 commit comments

Comments
 (0)