Giter VIP home page Giter VIP logo

asimov's People

Contributors

airballking avatar japonophile avatar mschuene avatar somethingelseentirely avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asimov's Issues

Services.

Someone has to implement services.

documentation and tutorials

Now that asimov is able to subscribe and publish to topics, it's time to craft it's api and to document it.
A good excercise for this would be to port the tutorial section of the roslisp package to clojure.

Exception when requiring asimov.api

Following README, I import asimov.api in the REPL and get the following exception:

user=> (require '[asimov.api :as ros])
ClassCastException java.lang.String cannot be cast to java.util.regex.Pattern  clojure.core/re-match
er (core.clj:4386)
user=> (.printStackTrace *e)
java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    ...
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern
    at clojure.core$re_matcher.invoke(core.clj:4386)
    at clojure.core$re_matches.invoke(core.clj:4423)
    at asimov.defaults$fn__28349.invoke(defaults.clj:12)
    at asimov.defaults__init.load(Unknown Source)
    at asimov.defaults__init.<clinit>(Unknown Source)
    ... 62 more
nil

Note that ROS_MASTER_URI is set in my environment:

$ env | grep ROS_MASTER_URI
ROS_MASTER_URI=http://localhost:11311

is it possible to have multiple message types for one topic

Is it possible that a topic can have multiple message types ?
We think not, but the ROS Master and Slave api's seem to suggest that it's possible because you always have to specify both the topic name and the message type for the topic.

If this would not be the case we could further simplify our api

parse return format

We need to agree on the format for the datastructure returned by parse-message
Current proposal:
bool a => [{:tag ::variable :type "bool" :name "a"}]
bool a=true => [{:tag ::constant :type "bool" :name "a" :value true}]
dasgeht/auch[][] a => [{:tag ::variable :type {:array {:array "dasgeht/auch"}} :name "a"]
see messages.clj in the current dev branch

add rospack support

rospack is a command line tool which helps finding dependencies and directories in regular ROS environments. Use it --if available-- from asimov:

  • rospack find <pkg> to find path corresponding to <pkg>
  • rospack depends <pkg> to find all dependencies of <pkg>
  • ~~maybe add a multi-arity alternative to (init-note! ...)~~

how to deal with host names when connecting to ros on remote machine

It is unfortunate that the ros master sends hostnames instead of fully qualified addresses.
For example after subsription to a topic example/topic, the master returns the address of the publishers of that topic.
In my experiments I am using the virtual machine Jan has set up for the lisp course.
The master returns the following address:
http://lisp-tutorial:

My current approach to handle this is having a global config with assoziations from host name to qualified address, but which can be overwritten by the local node config.
Anyone ideas regarding this?
Is it possible to tell the ros master to send fully qualified addresses ?

publishing from asimov kills rostopic command line tool

First of all, thanks for providing detailed descriptions on how to use asimov. Thanks a lot!

When I tried out part of the instructions from the top-level README, I ran into two issues. Here's what I did: I created a publisher which publishes once.

My project.clj file:

(defproject asimov-tutorials "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [asimov "0.1.1"]]
  :main ^:skip-aot asimov-tutorials.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

And my core.clj file:

(ns asimov-tutorials.core
  (require [asimov.api :as ros])
  (require [clojure.core.async :as a])
  (:gen-class))

(defn -main
  [& args]
  (println "Hello, Topic!")
  (let [m (ros/msgs "/opt/ros/hydro/share/turtlesim") ; the place of my turtlesim
        n (ros/init-node! "/asimov" "192.168.1.103"
                          "192.168.1.103" 11311
                          {"ai-uni-bremen-shared-laptop" "192.168.1.103"})
        out (ros/pub! n (m {:package "turtlesim" :name "Velocity"})
                      "/turtle1/command_velocity")]
    (a/put! out {:angular 2 :linear 2})))

Startup setup:

  • console 1: $ roscore
  • console 2: $ rostopic echo /turtle1/command_velocity
  • repl: asimov-tutorials.core> (-main)

Then I can see the following in console 2:

Traceback (most recent call last):
  File "/opt/ros/hydro/bin/rostopic", line 35, in <module>
    rostopic.rostopicmain()
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rostopic/__init__.py", line 1667, in rostopicmain
    _rostopic_cmd_echo(argv)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rostopic/__init__.py", line 1027, in _rostopic_cmd_echo
    _rostopic_echo(topic, callback_echo, bag_file=options.bag)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rostopic/__init__.py", line 676, in _rostopic_echo
    msg_class, real_topic, msg_eval = get_topic_class(topic, blocking=True)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rostopic/__init__.py", line 355, in get_topic_class
    msg_class = roslib.message.get_message_class(topic_type)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/roslib/message.py", line 99, in get_message_class
    cls = genpy.message.get_message_class(message_type, reload_on_error=reload_on_error)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genpy/message.py", line 599, in get_message_class
    cls = _get_message_or_service_class('msg', message_type, reload_on_error=reload_on_error)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/genpy/message.py", line 546, in _get_message_or_service_class
    raise ValueError("message type is missing package name: %s"%str(message_type))
ValueError: message type is missing package name: /

Question 1:
In my experience, rostopic is a robust tool. So, I suspect that it has a point when it says ValueError: message type is missing package name: /. Any idea where the issue might be?

Question 2:
Also, when I start the repl within the tutorials package (which is just the above code) compilation repeat-ably takes ~20s. Do you experience the same load-up times for asimov? If yes, is this usual for clojure libs of this size? If no, is there a way to profile the loading process?

Exception when reading msgs definitions

As mentioned in README, I read message definitions under resources and get an exception:

user=> (def m (ros/msgs "resources"))
IllegalArgumentException No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: java.lang.Character  clojure.core/-cache-protocol-fn (core_deftype.clj:541)

This seems to be a minor issue in the README, since passing a ["resources"] instead of "resources" solves the issue.

Simpler API.

We should simplify the API by introducing optional parameters or explicit option maps, in functions where default parameters can be deduced from the environment or ROS conventions.
For example init-node! should have an empty hosts map by default and should take the master port from the environment variables.

Is the empty message valid?

Is the empty message definition (no declarations just whitespace) valid?
Currently we accept also empty messages, is this wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.