Giter Site home page Giter Site logo

robotpt / cordial Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 4.0 7.05 MB

A framework for coordinating robot behavior.

License: MIT License

CMake 0.63% Python 13.97% HTML 2.20% JavaScript 80.48% CSS 1.10% Dockerfile 1.25% Shell 0.36%
hri robotics ros ros-kinetic

cordial's People

Contributors

adamhamden avatar apaikan avatar audrow avatar chrismbirmingham avatar cyunis avatar emilyxzhou avatar eshort avatar gjain234 avatar kswiftspong avatar ndennler avatar paudrow avatar prmehta24 avatar tgroechel avatar yangxqiao avatar

Watchers

 avatar

cordial's Issues

Make GUI use actions instead of services

Currently, the GUI uses services, which are blocking until a request is recieved. It would be much nicer to use actions, which can be canceled.

Also, this would allow the timeout logic to be moved from the GUI to be within the manager, which is probably better design.

Unify how parameters are accessed in classes

Currently, nodes take in parameters in several different ways. It would be nice to unify how this is done.

I think it would be good to assign parameters to variables in class constructors, this would be instead of reading the parameters outside of the constructor and passing them into the constructor, which is much more verbose.

Errors in Cordial GUI Example

Here is the error I found:

Traceback (most recent call last):
  File "example_say_and_ask_on_gui.py", line 4, in <module>
    from cordial_msgs.srv import Ask, AskRequest
ImportError: cannot import name Ask

Move GUI controller logic into the manager

It makes sense to move the GUI's controller into the manager because @emilyxzhou has updated the manager to use ROS actions, giving the manager the ability to cancel requests and update its plan based on feedback from the GUI (such as if the user is interacting with the GUI).

[CI] Make calling tests easier

Currently, we call each of the tests individually.

/bin/bash -c "source /root/catkin_ws/devel/setup.bash && rostest cordial_gui test_cordial_gui_actions.test && rostest cordial_gui test_cordial_gui_pubs_and_subs.test && rostest cordial_manager test_cordial_manager_actions.test && rostest cordial_manager test_cordial_manager_pubs_and_subs.test && rostest cordial_manager test_cordial_manager_services.test"

It would be nice to use test discovery. Perhaps we can use catkin build, which will probably require us to expose tests in the CMakeLists.txt files.

Run CI periodically

There are two major reasons to run our CI often, even if it's not associated with a push:

  1. It will help us find if a dependency breaks our current build
  2. It will help us identify flaky tests

Here is one possible way of doing this.

Make README more informative

The readme should mention the following:

  • What types of robot behavior this project coordinates
  • Mention the role of AWS in the interaction
  • Show a picture / gif of the face
  • Show a picture / gif of the GUI
  • Show what are the public topics, services, and actions
  • Explain that it currently uses Kinetic and Python 2.7
  • Have an On Contributing section

Update to Python 3

Cordial uses Python 2.7, which is no longer supported. ROS1 works with Python 3 (here is a tutorial). It would be great to allow Cordial to support Python 3.x.

Dockerfile should build from source each time

The Dockerfile currently builds from an image that has had cordial setup in it. I am not sure that tests the current branch, or the even the latest code in cordial. I think that we should build the full container each time that a push is created (i.e., the Dockerfile should start at the ROS kinetic image, install cordial's dependencies, and build cordial). It will take longer, but there are several reasons to do this:

  • It can test the current branch
  • It will let us know if any dependencies have been updated and break Cordial

I suspect that the reason an image with cordial setup is used is because it allows us to move the Dockerfile from the top directory. We can probably get around the issue by copying the projects contents beneath the Dockerfile (maybe using a symbolic link?) in the Github action. If this turns out to be difficult and the Dockerfile needs to be in the top directory, so be it.

One thing to realize is that when you make a Docker image, it is like a freeze of that container at a specific time. Your Dockerfile is not run in pulling the image. You just get the previous result of each line in the Dockerfile - that's what the layers are when you're pulling an image. These layers are like binary files, and that's why it's faster to pull an image than rebuild that image from a Dockerfile. It is because of this that code added to the image and packages installed will be in the same version when you pull the image at a later time as when you created the image originally.

Make failure to have valid AWS credentials more informative

Currently, the following error is raised when there are invalid AWS credentials.

AttributeError: CordialManager instance has no attribute '_aws_client'

It would be nice to make this error more informative by mentioning that the credentials are not working.

This error was mentioned in #18.

Add documentation on how to use Cordial

For example:

  • What topics do what and what their message type is
  • How the http servers work
  • An overview of how the manager works

This is probably best done after #5.

[cordial_gui] Add tests

This could be mostly unittests. Integration tests would also be great, but might be harder to do. This will probably be similar to #45.

[cordial_sound] Stream sound, instead of sending it all at once

Currently, sounds to be played is sent in one large message with the full sound to play. It would be much nicer if the sound was streamed to be played in smaller chunks (i.e., a second or less of sound). This would allow dialog to be interupted immediately.

Parameterize topic names

Currently, topic names are hard-coded into scripts that use them. It would be better to have all of the topics stored as parameters in ROS's parameter server.

This could be accomplished through having a single YAML file which lists all of the topics for this repository; this YAML file would then be loaded into the parameter server. This approach would also make it easier to control which topics should be public and private, as many topics are used internally and should not be publicly exposed.

Use GitHub Actions for continuous integration

Currently, we have a few tests, but they need to be run manually and are time-consuming. It would be useful to have continuous integration so that we can be sure that changes to the code or package updates won't break anything.

Here's an example repository using Actions for reference.

Fix flaky tests

The integration tests sometimes fail when executed in the Docker-based action, usually with the error message "AttributeError: CordialManager instance has no attribute '_aws_client'". Although this error is resolved upon re-running the action, the tests should be fixed so we can be sure that errors are caused by modifications to the code, and not the tests themselves.

Add setup instructions

It would be helpful to have documentation that talks about how to set up and use Cordial.

Make CI trigger on pull requests

Currently CI triggers only on push events (and soon on scheduled intervals #33). I did this because I could not figure out a way to get the branch name for both pull requests and push events.

  • For pushes, GITHUB_REF#refs/heads/ returns the branch name after stripping refs/heads from it.
  • For pull requests, the best way that I've found is to use github.event.pull_request.head.ref. GITHUB_REF#refs/heads/ returns something with merge and the PR's number, so that doesn't work.

I believe that we'll have have to use conditional logic to avoid having two workflows. Perhaps, this could be an example.

I'm surprised that I'm not able to find a better tool for doing this. I tried this action, which does the same thing as GITHUB_REF#/* (doesn't work for pull requests or pushes with a / in the name, e.g., audrow/feature would be parsed to feature). Perhaps this is worth trying.

[cordial_face] Add tests

This could be mostly unittests. Integration tests would also be great, but might be harder to do.

[cordial_manager] Add integration tests

It's important to have tests so we can ensure things are in a working state and have multiple people contribute.

Features

  • Uses rostest
  • Runs on Travis CI
    • Use AWS client with credentials

Example tests

  • Any messaging (publishers, subscribers, servers, clients, actions)
  • Interaction between CordialManager and AwsPollyClient

[CI] Run examples in CI

If possible, it would be great to run the examples in CI, so that we can confirm that they're always working (e.g., we can avoid things like #40).

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.