JuliaRobotics / Caesar.jl

Robust robotic localization and mapping, together with NavAbility(TM). Reach out to info@wherewhen.ai for help.
https://www.wherewhen.ai
MIT License
186 stars 31 forks source link

ROS Integration #227

Open dehann opened 5 years ago

dehann commented 5 years ago

Please add your comments or support for this requirement here.

dehann commented 5 years ago

also see:

colinxs commented 5 years ago

With ROS1 development currently frozen, I would consider ROS2. ROS2 addresses many of the shortcomings of ROS1, and is coming up on its third stable release. I have no personal experience with ROS2, but am considering using it in my own research. https://index.ros.org/doc/ros2/

dehann commented 5 years ago

FYI: https://github.com/ros2/rclc

dehann commented 5 years ago

FROM SLACK

@pvazteixeira

dehann commented 5 years ago
dehann commented 5 years ago

Id like to look at the messages that GMapping uses. The way ZMQ interface works is only one message type but then JSON pack the instructions inside that message. We could go either way, and pretty sure we will end up changing it again. My feeling is we should choose one direction to get the functionality in place and then tune the API once we have some experience?

dehann commented 5 years ago

https://husarion.com/tutorials/ros-tutorials/6-slam-navigation/

dehann commented 5 years ago

Imagine using turtlesim as driver for Tutorial 101 in ROS, Screenshot from 2019-10-07 17-13-14

dehann commented 5 years ago

Looks like these are the two main messages in the example:

#include <geometry_msgs/PoseStamped.h>
#include <tf/transform_broadcaster.h>
pvazteixeira commented 5 years ago

I think the gmapping/turtlebot example should be separated from the wider ROS integration issue. Caesar integration with ROS can happen in a few different ways:

  1. Build a front-end in julia and rely on RobotOS.jl (or a roscpp equivalent), in which case there is little to no work to do now. This is also where the turtlebot and gmapping examples fall: you subscribe to the relevant topics from the Julia side, and publish as needed. It's not really integration as all of Caesar remains in julia and it's up to the user/developer to play with RobotOS.jl to talk to ROS
  2. Expose an interface to factor graph operations (add/remove node/factor) - similar to the graff concept. With ROS, this could happen either as: 2.1. A caesar_msgs package in ROS - we'd specify the messages and use RobotOS.jl to create an endpoint on the julia side. 2.2. A ROS node implementing that interface as a set of services. In this case, we'd need to handle the transport/marshaling ourselves (e.g. use graff)

2.1. is very similar in spirit to isam server; 2.2. exposes the interface as a set of services and is much closer to the request/reply concept we discussed when building graff. As I'm biased to the latter, I'll try to get a proof of concept going and report back.

In any event, it would be good to get some more opinions on this before fully committing one way or another

pvazteixeira commented 5 years ago

Here a very limited version of what I meant with 2.2. in the previous comment. It uses graff to talk back to caesar.

dehann commented 5 years ago

right cool, i like the second option too (but biased to do that directly in Julia like first) and also skip Graff. We can then replicate the Graff calls inside Caesar. I mean something like start up CaesarCore and it works via ROS

very similar in spirit to isam server

dehann commented 5 years ago

Also, if the go between is in C++ can rather work through ZMQ than Graff.

pvazteixeira commented 5 years ago

see also: ROS PoC wiki page

autonomobil commented 4 years ago

Is there an update for roscpp.jl?

dehann commented 4 years ago

Hi @autonomobil, I didn't see your post until now, sorry! We have been using the RobotOS.jl interface (using PyCall) but haven't worked more on the roscpp implementation yet. Here is the latest work that allows consumption of bagfiles without using roscore: https://github.com/JuliaRobotics/Caesar.jl/blob/09f05022593effb4905d287c0969cd3c6b7e464e/src/ros/Utils/RosbagSubscriber.jl#L49

dehann commented 4 years ago

I should add this is becoming a standard feature that still requires some documentation, the basic idea is, and make sure ROS is in the environment before running:

using Pkg
ENV["PYTHON"]="/usr/bin/python" # or whichever one can run >>> import rospy
Pkg.build(PyCall)
using RobotOS
using Caesar

That should activate the ROS features in Caesar.

Current Examples

They might be slightly out of date, but fairly close. We are currently working here so these will be updated in due course.