Skip to content

Commit a313d94

Browse files
authored
Merge pull request #61 from JuliaRobotics/no-python
Don't require python when building LCM
2 parents 4050192 + 0762dee commit a313d94

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

Readme.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ From Julia, you can do:
2020
Pkg.add("LCMCore")
2121
```
2222

23-
Installing LCMCore.jl will automatically download and build a new copy of the LCM library for you.
23+
Installing LCMCore.jl will automatically download and build a new copy of the LCM library for you.
2424

2525
# Usage
2626

@@ -118,11 +118,9 @@ decode(data::Vector{UInt8}, ::Type{MyMessageType}) = <return an instance of MyMe
118118

119119
## Complex Message Types
120120

121-
Manually defining `encode()` and `decode()` functions is annoying, so we provide two more convenient ways of automating the process:
121+
Manually defining `encode()` and `decode()` functions is annoying, so we provide a convenient way to automate the process:
122122

123-
### Pure Julia: LCMType and @lcmtypesetup()
124-
125-
LCMCore.jl provides the `LCMType` abstract type and the `@lcmtypesetup` macro to make it easy to describe LCM message types in pure Julia. To use this approach, simply create a `mutable struct` which is a subtype of `LCMType`, and make sure that struct's field names and types match the LCM type definition. For a real-world example, check out CaesarLCMTypes.jl:
123+
LCMCore.jl provides the `LCMType` abstract type and the `@lcmtypesetup` macro to make it easy to describe LCM message types in pure Julia. To use this approach, simply create a `mutable struct` which is a subtype of `LCMType`, and make sure that struct's field names and types match the LCM type definition. For a real-world example, check out CaesarLCMTypes.jl:
126124

127125
* Type definition: [example_t.jl](https://github.com/JuliaRobotics/CaesarLCMTypes.jl/blob/bb26d44b1b04ba777049ec7f62f070e8ff2df5c5/src/example_t.jl)
128126
* Sender: [example_sender.jl](https://github.com/JuliaRobotics/CaesarLCMTypes.jl/blob/bb26d44b1b04ba777049ec7f62f070e8ff2df5c5/examples/example_sender.jl)
@@ -152,7 +150,7 @@ end
152150
@lcmtypesetup(example_t)
153151
```
154152

155-
The call to `@lcmtypesetup(example_t)` analyzes the field names and types of our Julia struct to generate efficient `encode()` and `decode()` methods. Note the use of SVectors from StaticArrays.jl to represent the fixed-length `position` array in the LCM type.
153+
The call to `@lcmtypesetup(example_t)` analyzes the field names and types of our Julia struct to generate efficient `encode()` and `decode()` methods. Note the use of SVectors from StaticArrays.jl to represent the fixed-length `position` array in the LCM type.
156154

157155
LCM types frequently contain variable-length vectors of primitives or other LCM types. For example, if we have the following LCM type definition:
158156

@@ -166,7 +164,7 @@ struct example_vector_t {
166164
}
167165
```
168166

169-
then we simply need to pass two additional arguments to `@lcmtypesetup`:
167+
then we simply need to pass two additional arguments to `@lcmtypesetup`:
170168

171169
```julia
172170
mutable struct example_vector_t <: LCMType
@@ -183,7 +181,7 @@ end
183181
)
184182
```
185183

186-
The format of each additional argument to `@lcmtypesetup` is `field_name => tuple_of_size_fields`.
184+
The format of each additional argument to `@lcmtypesetup` is `field_name => tuple_of_size_fields`.
187185

188186
Multi-dimensional arrays are also supported, including arrays with some fixed dimensions and some variable dimensions:
189187

@@ -216,11 +214,6 @@ end
216214
)
217215
```
218216

219-
### PyLCM: Automatic encoding and decoding through Python
220-
221-
If you don't want to bother with re-defining your LCM types in Julia, then there is an even simpler approach. The [PyLCM.jl](https://github.com/rdeits/PyLCM.jl) uses LCMCore.jl under the hood, and it also allows you to also encode and decode any Python LCM type automatically. Performance of PyLCM will be significantly worse than the pure-Julia approach, but it can be very convenient.
222-
223-
224217
## Reading LCM log files directly
225218

226219
LCM log files can also be read directly, without the UDP multicasting events.

deps/build.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ end
2121
validate_lcm(name, handle) = occursin(dirname(@__FILE__), name)
2222

2323
@static if Sys.islinux()
24-
python = library_dependency("python", aliases=["libpython2.7.so", "libpython3.2.so", "libpython3.3.so", "libpython3.4.so", "libpython3.5.so", "libpython3.6.so", "libpython3.7.so", "libpython3.8.so"], validate=cflags_validator("python", "python2", "python3"))
25-
glib = library_dependency("glib", aliases=["libglib-2.0-0", "libglib-2.0", "libglib-2.0.so.0"], depends=[python], validate=cflags_validator("glib-2.0"))
24+
glib = library_dependency("glib", aliases=["libglib-2.0-0", "libglib-2.0", "libglib-2.0.so.0"], validate=cflags_validator("glib-2.0"))
2625
lcm = library_dependency("lcm", aliases=["liblcm", "liblcm.1"], depends=[glib],
2726
validate=validate_lcm)
2827

29-
provides(AptGet, Dict("python-dev" => python, "libglib2.0-dev" => glib))
28+
provides(AptGet, Dict("libglib2.0-dev" => glib))
3029
else
3130
glib = library_dependency("glib", aliases = ["libglib-2.0-0", "libglib-2.0", "libglib-2.0.so.0"])
3231
lcm = library_dependency("lcm", aliases=["liblcm", "liblcm.1"], depends=[glib],

0 commit comments

Comments
 (0)