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

ROS2TalkerActivity.java logic issue:talkerNode.stop() will be run again , node will be stop twice? #18

Open
pengzhouhu opened this issue Dec 13, 2021 · 2 comments

Comments

@pengzhouhu
Copy link

pengzhouhu commented Dec 13, 2021

when we click stop button,  OnClickListener() will run the changeState(false), this api will run the talkerNode.stop(), and when we down this, talkerNode.stop() will run again , so node will be stopped twice?

code path : ros2_android_examples/ros2_talker_android/src/main/java/org/ros2/examples/android/talker/ROS2TalkerActivity.java

just like below:

// Create an anonymous implementation of OnClickListener
private OnClickListener startListener = new OnClickListener() {
public void onClick(final View view) {
Log.d(logtag, "onClick() called - start button");
Toast
.makeText(ROS2TalkerActivity.this, "The Start button was clicked.",
Toast.LENGTH_LONG)
.show();
Log.d(logtag, "onClick() ended - start button");
Button buttonStart = (Button)findViewById(R.id.buttonStart);
Button buttonStop = (Button)findViewById(R.id.buttonStop);
changeState(true);
}
};

// Create an anonymous implementation of OnClickListener
private OnClickListener stopListener = new OnClickListener() {
public void onClick(final View view) {
Log.d(logtag, "onClick() called - stop button");
Toast
.makeText(ROS2TalkerActivity.this, "The Stop button was clicked.",
Toast.LENGTH_LONG)
.show();
changeState(false);
Log.d(logtag, "onClick() ended - stop button");
talkerNode.stop();

}
};

@pengzhouhu
Copy link
Author

pengzhouhu commented Dec 16, 2021

@cuihaifengchina
Copy link

大哥,你安卓的项目跑的起来吗?我这边一直报错
CMake Error at CMakeLists.txt:18 (find_package):
By not providing "Findspdlog_vendor.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"spdlog_vendor", but CMake did not find one.

Could not find a package configuration file provided by "spdlog_vendor"
with any of the following names:

spdlog_vendorConfig.cmake
spdlog_vendor-config.cmake

Add the installation prefix of "spdlog_vendor" to CMAKE_PREFIX_PATH or set
"spdlog_vendor_DIR" to a directory containing one of the above files. If
"spdlog_vendor" provides a separate development package or SDK, be sure it
has been installed.

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

No branches or pull requests

2 participants