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

[base][mocap]: add an option "enable_optitrack: true". #621

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

Li-Jinjie
Copy link
Contributor

@Li-Jinjie Li-Jinjie commented Aug 17, 2024

If this option is not set, the first connection can be made. But once you shutdown this connection, maintain roscore in one computer, and try to do another "roslaunch aerial_robot_base mocap.launch", the connection always fails. The only way is to shutdown the roscore and do roslaunch again.

Add this option can fix the problem mentioned above. Tested in 0066.

…ption, the connection to mocap can be established only once.
@tongtybj
Copy link
Collaborator

It sounds wired...
Becuase enable_optitrack is always true as default:
https://github.com/ros-drivers/mocap_optitrack/blob/master/src/mocap_config.cpp#L69

Can you dump the value of this variable when you run the node, and compare the results between with and without your patch?

@Li-Jinjie
Copy link
Contributor Author

OK, I will test it on Monday.

@Li-Jinjie
Copy link
Contributor Author

If we don't set this value, for the first run, the enableOptitrack can be set to 1 by default.

[ WARN] [1724039169.350641447]: Could not get enable optitrack, using default: 1
[ WARN] [1724039169.352661334]: Could not get server version, using auto
[ WARN] [1724039169.353305319]: Failed to parse odom for body 1. Odom publishing disabled.
[ WARN] [1724039169.353321242]: Failed to parse tf for body ``. Tf publishing disabled.
[ WARN] [1724039169.353328661]: tf is not found in the configtf for body 1. TF publishing disabled.
[ERROR] [1724039169.356911610]: serverDescription.enableOptitrack: 0
[ WARN] [1724039169.356936564]: enableOptitrack is False. Initialization is uncompleted.
[ERROR] [1724039169.357799937]: serverDescription.enableOptitrack: 1
[ WARN] [1724039170.358444244]: Client has not received server info request. Parsing data message aborted.
[ WARN] [1724039170.361970986]: NATNet Version : 4.1.0.0
[ WARN] [1724039170.361994939]: Server Version : 3.1.1.1
[ WARN] [1724039170.364784255]: Initialization is completed.
[ WARN] [1724039170.364800823]: Running...

However, for the second run, the enableOptitrack cannot be set to 1.

[ WARN] [1724039177.062203546]: Could not get server version, using auto
[ WARN] [1724039177.062884631]: Failed to parse odom for body 1. Odom publishing disabled.
[ WARN] [1724039177.062895496]: Failed to parse tf for body ``. Tf publishing disabled.
[ WARN] [1724039177.062905874]: tf is not found in the configtf for body 1. TF publishing disabled.
[ERROR] [1724039177.065013813]: serverDescription.enableOptitrack: 0
[ WARN] [1724039177.065023648]: enableOptitrack is False. Initialization is uncompleted.
[ERROR] [1724039177.065863651]: serverDescription.enableOptitrack: 0
[ WARN] [1724039177.065871082]: enableOptitrack is False. Initialization is uncompleted.
[ WARN] [1724039177.065877737]: Running...

I guess this situation may be related to the default value of cfg: https://github.com/ros-drivers/mocap_optitrack/blob/master/cfg/MocapOptitrack.cfg#L5

@tongtybj
Copy link
Collaborator

@Li-Jinjie

Thank you for your analysis!

This PR works for us (and I will merge latter), but I also think it might be better to directly correct the default value in cfg which can benefit for all users.

@Li-Jinjie
Copy link
Contributor Author

@Li-Jinjie

Thank you for your analysis!

This PR works for us (and I will merge latter), but I also think it might be better to directly correct the default value in cfg which can benefit for all users.

I have created a PR here: ros-drivers/mocap_optitrack#84

@tongtybj
Copy link
Collaborator

@Li-Jinjie

Perfect!

@tongtybj tongtybj merged commit bc8da3f into jsk-ros-pkg:master Aug 22, 2024
5 checks passed
@Li-Jinjie Li-Jinjie deleted the PR/fix-bug-mocap branch September 16, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants