Ask Your Question
2

Exceptions not being caught using rosbridge version 1.0

asked 2012-10-05 04:15:37 -0500

Pi Robot gravatar image

updated 2012-10-05 04:16:21 -0500

Hello,

I have been developing an HTML5/Javascript GUI using version 1.0 of rosbridge and most functions are working perfectly. However, I just noticed that my Javascript is not catching rosbridge exceptions where I assume they should occur. For example, if I follow the tutorial and run:

var connection = null;
try {
    connection = new ros.Connection("ws://foobar:1234");
} catch (err) {
    log('Failed to connect to rosbridge!');
    return;
}
log('Connection successful!');

where neither host foobar nor the port 1234 is valid, I don't see the "Failed to connect" message. Instead I see the "Connection successful" message. Similar exceptions such as trying to connect to a non-existent service are not being caught. Is this a Javascript problem or a rosbridge problem?

Thanks!
patrick

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-10-05 04:22:26 -0500

Victor Lopez gravatar image

updated 2012-10-05 04:22:42 -0500

I know this is not the answer you are expecting, but I recently migrated from rosbridge 1.0 to rosbridge 2.0 and I'm extremely pleased with the results.

Rosbridge 2.0 is much more robust, consumes way less resources and has many other features.

If you already have a working websocket implementation, the migration shouldn't be hard at all.

edit flag offensive delete link more

Comments

Thanks @Victor. Migrating to version 2.0 is probably the best answer so I'll give it a try. I'll wait to see if anyone has a fix for version 1.0 before checking off your answer.

Pi Robot gravatar imagePi Robot ( 2012-10-05 06:20:45 -0500 )edit

@Victor: I'm finding the rosbridge 2.0 documentation very sparse and not sufficient for me to figure out how to translate my rosbridge 1.0 code to 2.0. Do you know of any 2.0 examples out there that use the Javascript client in an HTML application?

Pi Robot gravatar imagePi Robot ( 2012-10-11 04:21:57 -0500 )edit

No, I am sorry. I implemented a client using Qt in C++. But I believe all you need is a websocket client and on top of that implement the protocol described in this document: http://kforge.ros.org/rosbridge/trac/raw-attachment/wiki/WikiStart/rosbridge%20protocol%20specification.pdf

Victor Lopez gravatar imageVictor Lopez ( 2012-10-14 21:31:14 -0500 )edit

@Pi Robot Did you eventually migrate to Rosbridge 2.0? Can you show the process of your migration?

Andrew.A gravatar imageAndrew.A ( 2014-10-23 22:59:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-10-05 04:15:37 -0500

Seen: 161 times

Last updated: Oct 05 '12