ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

What is the recommended approach for creating Erlang language bindings?

asked 2012-12-10 14:27:20 -0500

tleyden gravatar image

I would like to communicate with ROS via Erlang, and there seems to be two possible approaches:

A) Erlang library that knows how to talk to ROS via TCPROS (eg, pure Erlang approach)

or

B) Call ROS C library from Erlang (eg, something akin to JNI)

I see for Java, it started out with a JNI approach and then it was switched to a pure Java approach, which tells me a pure Erlang approach might be the best approach.

Just curious, how often does the TCPROS protocol change? Does it change every major release or is it relatively stable?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-12-10 21:11:46 -0500

Lorenz gravatar image

The TCPROS protocol did not change for years. The only thing that had to be updated was the message generator because some old libraries and tools were deprecated and replaced by newer libraries.

I think although it might be more work and harder to implement, approach A will definitely be more robust and integrate better in Erlang. If you just want a quick solution, you can use a foreign function interface. But note that you first need to wrap the ROS C++ library into a C library to do that which can be quite cumbersome, too. Also, in that case you need to implement marshaling from Erlang data types to the corresponding C++ data types in order to transmit them with roscpp.

edit flag offensive delete link more
1

answered 2012-12-13 05:35:45 -0500

tleyden gravatar image

updated 2012-12-13 05:37:14 -0500

Thanks for that feedback, that's very useful. Yeah, I would definitely like to try to avoid having to write any low level type conversion code.

I realized that a simpler approach would be to use RosJava along with Erlang's JInterface.

image description

DXNN2 (github://DXNN2) is an evolutionary neural network framework in Erlang, which is the main reason I want to be able to interface Erlang and ROS.

edit flag offensive delete link more

Comments

I was not able to get RosJava to build, and so I ended up using python instead. A "hello world" to connect ROS <-> Erlang via python is available here: https://github.com/tleyden/hello_ros_erlang

tleyden gravatar image tleyden  ( 2012-12-15 11:19:51 -0500 )edit

Question Tools

Stats

Asked: 2012-12-10 14:27:20 -0500

Seen: 1,022 times

Last updated: Dec 13 '12