-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement a new plugin using Robot Interface #10
Comments
Sorry for the inconvenience, but we are not sure how to proceed and to divide the problem in sub-steps |
Hello, sorry I was out for a conference last week (in general, if you want to write messages with more priority just mention people, for example @traversaro in my case). |
Anyhow, I have a bit of backlog, I should be able to reply to this issue this evening or tomorrow, sorry! |
Don’t worry! Thank you very much again. |
Sorry, I am back to this. So, a possible division in substeps is:
|
If you have any doubt just ask or let's have a call. |
Sorry but in the last days we were a bit busy.
It seems that the FakeIMU device is created correctly, but for some reason it is not found during the attach phase. |
Great! This is indeed why I wanted you to do the steps. When you create a device outside of the yarprobotinterface, you need to explicitly "pass" their pointers of the devices to the robotinterface. To do so, you need to call the |
Okay done! We completed step3 (4f6f455). Thank you! |
We proceeded with step 4 (5a52755). For the moment we tried using the .xml file of step1 and step2 (i.e. the one with both fakeIMU and multipleanalogsensorsserver devices) and it works. Now we are trying to use the .xml file of step3 (i.e. the one with only the multipleanalogsensorsserver device) and to
It seems to do everything correctly (also the attach phase), but at the end we have this segmentation fault. |
Which version of YARP are you using? We had some fixes recently to mas-related devices. |
We are using YARP version 3.7.0 |
Yes, I think you may need robotology/yarp#2970 and robotology/yarp#2967 that was only included in YARP 3.8.1 . Depending on how you installed YARP, it changes how to updaate it. If the issue persists after updating to YARP 3.8.1 and recompiling all the software that depends from YARP and you compiled from source, probably it would be helpful to compile the code in Debug mode and collect a detailed stacktrace of the crash. |
We installed YARP from binary, so we tried to install it again (to have the more recent version), but the version was still 3.7.0. So we proceeded installing YARP from source and the resulting version is the 3.8.1 as we wished. However, if we launch our program, the following error occurs:
Indeed if we look into usr/local/share/yarp/plugins we cannot find the fakeIMU.ini file.
In particular, we noticed that |
You need to enable an appropriate option when configuring the project, you can see the available options with the ccmake command instead of cmake. |
I checked in https://github.com/robotology/robotology-superbuild/blob/master/cmake/BuildYARP.cmake#L84 and indeed the option to enable is YARP_COMPILE_ALL_FAKE_DEVICES . |
Okay thank you! However, we have the same problem in step4 that we had with YARP 3.7.0:
|
If you are sure that the /usr/local/lib/libYARP_os.so.3 library is indeed YARP 3.8.1, then I suggest to compile YARP and your code in Debug mode and then collect a detailed stacktrace with details on the line of code at which this segfaults happens. |
After having compiled both YARP and our code in debug mode, we used gdb to collect information about the segmentation fault:
|
We don’t know if we can consider the previous steps as completed. In that case, which might be the next steps to follow? Thank you very much. |
If a new problem arises, we need to fix it even if it was not planned, I am afraid we need to fix the problem with Step 4, otherwise it will make it impossible to go forward. Anyhow, thanks for pinging, I forgot we still had this problem. |
Ok thanks, we wait for news! |
I will look into this as it seems quite a tricky problem, but even if a problem is hard if I was in you I would avoid to just wait for somebody to just provide the solution: tryng to solve an hard problem you do not know how to solve may be frustrating, but it is a great way to learn new skills. |
Thanks for the nice README in https://github.com/robotology/study-gazebo-garden-yarp-plugins/blob/main/robotinterface/step4/README.md, it was quite easy to reproduce the problem. The output on my system is:
|
Ok, I understood the problem. The key thing that you need to understand is lifetime and ownership of objects (including YARP devices). In your example, you define the |
Okay we understood the problem and solved it (be3aefc). Thank you very much and sorry for the incovenience. |
No problem, feel free to ask for any problem! |
Ok thanks! So, at this point what do you suggest to do? |
I think we can go back to the original goal! We need to:
|
We are a bit confused about how to proceed. For example we are not sure about how our YARP device should access data from Gazebo simulation. |
This is indeed the tricky point of all the implementation, also on the gazebo classic plugins it was not obvious as it involved the use of a singleton. When do you prefer to have the call? I am quite available in this days, so please let me know when you are available. |
We are avaiable today from 3 pm, or every day of the next week (except Tuesday) |
Sorry but we forgot to precise that today we are available only from 3 to 5 pm |
Can we do at 15:30 ? Can you set up a meeting and send an invitation at [email protected] ? Thanks! |
Sorry, I can't make it at 15:30 due to unexpected events. Can we do on Monday at 11:00 in the morning? |
Ok no problem! |
I investigated the problem we discussed in the meeting, and I found that the
So you just need to link |
Thank you very much. |
We managed to implement the YARP device using also the concept of the singleton that you explained to us in the last meeting. We have some problems related to the use of the callback mechanism in ForceTorqueDriver, because we don't find anything similiar to what you used in Gazebo Classic.
In Gazebo Garden in our first simple plugin we used PostUpdate callback, provided by ISystemPostUpdate, and we didn't handle directly the callback registration. You can find here what we have already done for the moment (20fbaea) |
Cool, nice job! Probably if there is no callback equivalent, want we can do is to define a structure that contains the information that need to be passed between the YARP device and the Gazebo plugin in a structure, like:
Then, you can allocate this object in the Gazebo plugin, and in the singleton pass a pointer to this object. Then, you can populate the data of this object in the |
Okay, thank you very much for the suggestion.
We should have done (robotinterface/step5). |
Great job! I will look more into this next week, and then we can decide what to do next! |
I have a simple question.
It happens also putting the GazeboYarpRobotInterface plugin at the end of the model, as you did in https://github.com/robotology/gazebo-yarp-plugins/blob/master/tutorial/model/forcetorque/model.sdf |
Interesting, I guess it boils down to the order used by Gazebo to launch plugins, in Gazebo Classic first the plugin in the nested entities were launched, while in Gz it seems the contrary, that is a bit problematic for us. I will look a bit in gz-sim code and let you know. |
Anyhow, probably it make sense to open a new issue to track this improvement? This issue has been already quite long and difficult to follow, as we reached an MVP we can consider it solved and open new issues for the improvements. |
Recalling the meeting on last wednesday, we should proceed with this new task. As usual, we would like to divide this issue in different sub-steps to better understand the problem. What do you suggest us to start with?
The text was updated successfully, but these errors were encountered: