Skip to content
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

Better error reporting from server #380

Open
jpreiss opened this issue May 10, 2021 · 5 comments
Open

Better error reporting from server #380

jpreiss opened this issue May 10, 2021 · 5 comments
Labels

Comments

@jpreiss
Copy link
Collaborator

jpreiss commented May 10, 2021

The Crazyswarm server sometimes fails with an uninformative error message, see e.g. #379. More informative error messages could help reduce the Q&A load.

@jpreiss
Copy link
Collaborator Author

jpreiss commented Sep 30, 2021

1e1c2b1 also for this issue

@jpreiss
Copy link
Collaborator Author

jpreiss commented Sep 30, 2021

A big one is integer values in crazyflies.yaml initialPosition coordinates. This causes an XmlRpcException, but not from here:

nGlobal.getParam("crazyflies", crazyflies);

I ran out of time to investigate today, but maybe the exception is happening in the rosparam node?

@whoenig
Copy link
Contributor

whoenig commented Sep 30, 2021

My guess is that this is from

ROS_ASSERT(pos[j].getType() == XmlRpc::XmlRpcValue::TypeDouble);

This should probably also allow integers and use a simple assignment in the integer case.

@jpreiss
Copy link
Collaborator Author

jpreiss commented Sep 30, 2021

Oh, does ROS_ASSERT raise an XmlRpcException? I would not have guessed that...

I agree that accepting integers is a better solution.

@whoenig
Copy link
Contributor

whoenig commented Sep 30, 2021

No, ROS_ASSERT probably doesn't raise such an explicit exception:-( Like a normal assert, it's also disabled in release builds. The problem is likely the next line, which calls a cast operator (http://docs.ros.org/en/noetic/api/xmlrpcpp/html/classXmlRpc_1_1XmlRpcValue.html#a95fa5d878b5c5946994b49f02829efc0):

double f = static_cast<double>(pos[j]);

I assume we would need a switch/if statement here and handle both the int and double case. Luckily, there are no more other (relevant) types...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants