Skip to content

Commit

Permalink
Update codegen for ROS 2 bouncy
Browse files Browse the repository at this point in the history
  • Loading branch information
nstiurca committed Jul 13, 2018
1 parent 2092240 commit 06a2f2a
Show file tree
Hide file tree
Showing 4 changed files with 639 additions and 170 deletions.
8 changes: 5 additions & 3 deletions gen/wrap_rcl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
# Based heavily on CUFFT.jl/gen/wrap_cufft.jl
# https://github.com/JuliaArchive/CUFFT.jl/blob/master/gen/wrap_cufft.jl

# Note: needs package libclang-dev

using Clang, Clang.cindex
# We'll replace some of the wrap functions, and we need to call the following:
import Clang.wrap_c: repr_jl, rep_type, rep_args, name_safe

const ROS_DISTRO = ENV["ROS_DISTRO"]
@assert ROS_DISTRO == "ardent" # the only available version of ROS2 for now
@assert ROS_DISTRO == "bouncy" # the only supported version of ROS2 for now
const AMENT_PREFIX_PATH = ENV["AMENT_PREFIX_PATH"]
const ROS_INCLUDE_PATH = joinpath(AMENT_PREFIX_PATH, "include")

Expand All @@ -24,7 +26,7 @@ for (lib, hdr) in (("rcl", "rcl.h"),)
header_library = _ -> "lib$lib",

clang_includes=[
"/opt/ros/ardent/include",
ROS_INCLUDE_PATH,
"/usr/include",
"/usr/lib/llvm-3.9/lib/clang/3.9.1/include"],
header_wrapped = (header_file, cursor_name) -> (
Expand Down Expand Up @@ -85,4 +87,4 @@ function wrap_c.wrap(buf::IO, funcdecl::FunctionDecl, libname::String)
println(buf, "end")
end

# wrap_c.wrap_c_headers(context, context.headers)
# wrap_c.wrap_c_headers(context, context.headers)
3 changes: 2 additions & 1 deletion gen/wrap_rcl2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include("../src/find_ros2.jl")
clang_includes=[
ROS_INCLUDE_PATH,
"/usr/include",
"/usr/lib/llvm-6.0/lib/clang/6.0.0/include", # stdbool.h
"/usr/lib/llvm-3.9/lib/clang/3.9.1/include", # stdbool.h
]

Expand All @@ -38,4 +39,4 @@ context.headers = [
joinpath(ROS_INCLUDE_PATH, "rcl", "node.h"),
joinpath(ROS_INCLUDE_PATH, "rcl", "rcl.h"),
]
run(context)
run(context)
Loading

0 comments on commit 06a2f2a

Please sign in to comment.