gstavrinos / ROS.jl

A Julia wrapper of the ROS C++ client.
BSD 3-Clause "New" or "Revised" License
41 stars 2 forks source link

`@ROS.genNew` and `@ROS.updateAll` not running #7

Closed sscheele closed 3 years ago

sscheele commented 3 years ago

I installed ROS.jl by following these steps:

  1. Install Julia 1.3.1, enter my Julia environment, and run pkg> add ROS
  2. Fix Cxx.jl error (error: run-time type information was enabled in PCH file but is currently disabled <built-in>:1:10: fatal error: 'Cxx.h' file not found) by exiting Julia, doing export JULIA_CXX_RTTI=1, and re-building Cxx.

At this point, I could successfully run using ROS;, so the next thing I tried was ROS.@updateAll. This gave the following stack trace:

ERROR: LoadError: BoundsError: attempt to access 36-element Array{Tuple{AbstractString,Symbol,Int64,Int64,Bool},1} at index [124]
Stacktrace:
 [1] getindex(::Array{Tuple{AbstractString,Symbol,Int64,Int64,Bool},1}, ::Int64) at ./array.jl:744
 [2] #s37#70 at /home/sam/.julia/packages/Cxx/1RaOv/src/cxxstr.jl:705 [inlined]
 [3] #s37#70(::Any, ::Any, ::Any, ::Any) at ./none:0
 [4] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any,N} where N) at ./boot.jl:524
 [5] getAll() at /home/sam/.julia/packages/ROS/VTErh/src/package.jl:10
 [6] msgGenerator(::Bool) at /home/sam/.julia/packages/ROS/VTErh/src/typegen.jl:359
 [7] @genNew(::LineNumberNode, ::Module) at /home/sam/.julia/packages/ROS/VTErh/src/typegen.jl:382
in expression starting at REPL[3]:1

Running ROS.@genNew produces the same error. Do you know what is causing this?

gstavrinos commented 3 years ago

Hmm, this is weird. Can you use any other Julia package that utilizes Cxx?

sscheele commented 3 years ago

I've just confirmed that I can use Spot.jl (https://github.com/sisl/Spot.jl), which also uses Cxx.

gstavrinos commented 3 years ago

Thanks for giving this a quick test. Can you give me more information about your setip? OS and ROS versions specifically. It would also help if you could give me a complete list of your ROS messages.

sscheele commented 3 years ago

Sure! It's Ubuntu 18.04, ROS Melodic, with these messages (output of rosmsg list): https://pastebin.com/WLPiwzkC

gstavrinos commented 3 years ago

I don't see any easy to spot problems on your setup to be honest. Do you have any images of your system? Nevertheless, I will try to install some of the non standard messages you have in your list and check where the problem lies. I will keep you posted on the issue.

gstavrinos commented 3 years ago

Hey @sscheele,

I looked into your problem, and found out that Cxx acts weirdly with precompilation enabled. The issue has been fixed in the new release (https://github.com/gstavrinos/ROS.jl/releases/tag/v0.2.4). The CI tests were including (include("src/ROS.jl") the ROS package instead of using it (using ROS) so the problem slipped through. Thanks for your issue.

I am closing it, but please feel free to re-open it if you encounter it again, or open a new one for new problems that may arise. (Keep in mind that ROS.jl is (still!) in a non major version)