New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Services code review 1 #22

Closed
wants to merge 44 commits into
base: dev
from

Conversation

Projects
None yet
2 participants
@rgleichman
Collaborator

rgleichman commented Oct 18, 2014

I have been working on implementing services and thought it would be nice to get some feedback. This is still a work in progress, so this should not be merged.

Check out the new tests in Tests/MsgGen.hs, and Tests/ServiceClientTests/ServiceClientTest.hs (instructions in comments). Right now it can generate Haskell types for service messages (tested by MsgGen), and call ROS services without any error handling (tested by ServiceClientTest).

Service message generation is not yet integrated into the executable.

Service Haskell types are just like message types except that they are also instances of SrvInfo. The generated Haskell message type files should be the same as before except they might have an extra newline at the end.

Except for MsgGen, changes to existing code are minimal: there is some code extraction and changes suggested by hlint.

rgleichman added some commits Jul 20, 2014

Fixed testGeneratedHaskell to take lists so that the Haskell types ca…
…n be generated simultaneously. The gen tests now pass, still need to update md5 specific tests.
Revert breaking changes to negotiateService, add servicetest test sui…
…te (in progress), add add_two_ints_server.py as a local file for servicetest.
@rgleichman

This comment has been minimized.

Show comment
Hide comment
@rgleichman

rgleichman Oct 18, 2014

Collaborator

The Travis build fails since ServiceClientTest (servicetest test suite) needs manual set up.

Collaborator

rgleichman commented Oct 18, 2014

The Travis build fails since ServiceClientTest (servicetest test suite) needs manual set up.

@rgleichman

This comment has been minimized.

Show comment
Hide comment
@rgleichman

rgleichman Oct 23, 2014

Collaborator

Since making the pull request I have added error detection and exception handling to callService.

Collaborator

rgleichman commented Oct 23, 2014

Since making the pull request I have added error detection and exception handling to callService.

Show outdated Hide outdated Tests/MsgGen.hs Outdated
Show outdated Hide outdated Tests/MsgGen.hs Outdated
@@ -0,0 +1,41 @@
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable, DeriveGeneric #-}

This comment has been minimized.

@acowley

acowley Oct 24, 2014

Owner

Should this and the generated Response be in the repository?

@acowley

acowley Oct 24, 2014

Owner

Should this and the generated Response be in the repository?

This comment has been minimized.

@rgleichman

rgleichman Oct 25, 2014

Collaborator

They are needed by ServiceClientTest.hs. I do not know what the alternative would be. It might be nice to have an integration test that both generates the message types and calls the service.

@rgleichman

rgleichman Oct 25, 2014

Collaborator

They are needed by ServiceClientTest.hs. I do not know what the alternative would be. It might be nice to have an integration test that both generates the message types and calls the service.

@@ -169,8 +174,21 @@ test-suite testexe
type: exitcode-stdio-1.0
hs-source-dirs: Tests, src/executable
main-is: AllTests.hs
ghc-options: -Wall
ghc-options: -Wall -O0

This comment has been minimized.

@acowley

acowley Oct 24, 2014

Owner

Curious about the -O0. Is it just for faster compilations?

@acowley

acowley Oct 24, 2014

Owner

Curious about the -O0. Is it just for faster compilations?

This comment has been minimized.

@rgleichman

rgleichman Oct 24, 2014

Collaborator

Yes.

@rgleichman

rgleichman Oct 24, 2014

Collaborator

Yes.

Show outdated Hide outdated src/Ros/Graph/Master.hs Outdated
Show outdated Hide outdated src/Ros/Node/RosTcp.hs Outdated
Show outdated Hide outdated src/Ros/Node/RosTcp.hs Outdated
Show outdated Hide outdated src/Ros/Service/ServiceTypes.hs Outdated
Show outdated Hide outdated src/executable/Gen.hs Outdated
@acowley

This comment has been minimized.

Show comment
Hide comment
@acowley

acowley Oct 24, 2014

Owner

This is an outstanding job! It's really great that not only will this add a really useful feature, but I think it's forcing improvements through the existing code you've had to touch.

Owner

acowley commented Oct 24, 2014

This is an outstanding job! It's really great that not only will this add a really useful feature, but I think it's forcing improvements through the existing code you've had to touch.

Show outdated Hide outdated src/Ros/Graph/Master.hs Outdated
@rgleichman

This comment has been minimized.

Show comment
Hide comment
@rgleichman

rgleichman Oct 25, 2014

Collaborator

The previous two commits should address the remaining comments.

Collaborator

rgleichman commented Oct 25, 2014

The previous two commits should address the remaining comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment