-
Notifications
You must be signed in to change notification settings - Fork 6
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
Myactuator status broadcast #1
base: main
Are you sure you want to change the base?
Conversation
broadcaster
Thank you, @ioio2995 ! From what I have seen so far working with the actuator - at least on my system - any request to the actuator takes around 1 millisecond. I am unsure if that is related to my kernel configuration (see |
…ue to concurrent access to CAN resource)
Hello,
Yes, indeed I had the same constraint. Unfortunately, the problem remains complex because, given that the Hall effect sensor magnet is placed on the motor shaft (input shaft), it does not undergo the reduction. It works perfectly when the controller is powered, but if the output shaft is manipulated by more than 43 degrees (motor off), for the X8pro V2 which undergoes a 1/9 reduction for example, we lose motor turns and the output shaft is offset when powered back on. A solution was implemented for the single turn with the V3 versions and the second encoder (provided that myActuator support responds to our requests for an updated firmware). The workaround I put in place is the systematic reset of the encoder via a 0x63 command. I did some tests with robot_localization and an IMU which are promising. But it remains a workaround.
I have taken your proposals into account, indeed activating the retrieval of motor_status1 and 3 on demand is a good approach. I had initially considered creating a second thread, but reading the CAN interface obviously poses problems. I tried to make progress, but without real success.
I am not too convinced of the use of GPIOs: for using the brake it would be perfect, but for retrieving the various hardware indicators of the motor, a low-speed broadcast still seems the best solution. Also, while going through your code and modifying the I have also created a branch on my side for implementing timeout management, but it lacks passing the value as an argument in the launch file. I will do this over the weekend if my kids give me a break. For your information, I am a former system engineer who came to ROS to stay connected with hardware, so I am not a developer, but I am doing my best to keep learning. English is not my strong suit, so please excuse any mistakes I might make. Best regards |
Hmmm, I did not know about the Hall effect sensor being only motor-sided. That sounds like a very limiting design decision that seems to have no advantages to me. |
Regarding the noisy torque: Just implemented a simple low-pass filter of the torque and the velocity. The filter coefficients can be adjusted through another parameter inside the URDF.
|
… only if extra_status_refresh_rate is different from 0.
Getting out of bed and between two episodes of Paw Patrol, I implemented a new logic for retrieving additional status data. Instead of using a second thread, I opted for a sleep-wake mechanism. What do you think? I also moved the initialization of variables related to the use of extra-statuses to the on_init function to avoid their loading by the resource_manager if not used. I tested your implementation of the low-pass filter and it's night and day, excellent improvement! To merge our branches, could you provide your requirements? It might be useful to create a story to centralize this discussion. My GitHub profile is still empty, but I will update it. The project I'm working on is a two-wheeled robot with an articulated tail ending in an omnidirectional wheel. The tail adds an extra level of mobility. Although I am working alone to showcase it, the project will remain open source. https://github.com/ioio2995/rhacobot Finally, what do you think of my second PR? I noticed it conflicts with the master branch, I will fix it so you can merge it if it suits you. |
Hi again @ioio2995, |
Hello, I have just done some tests on two X8PRO3-H.
I am using a homemade USB-to-CAN adaptation (https://github.com/ioio2995/twai_slcan) using an ESP32. |
Indeed, the use of extra_status will add additional latency. But let’s not forget that my latest commits have made the request frequency much more flexible and they are no longer dependent on the cycle_time. Therefore, nothing prevents us from sending an extra_status request every second. |
Thanks a lot! The data looks much better than mine. 1.1ms is not too bad. |
This afternoon, I conducted some additional tests to evaluate my CAN controller and observe latencies by increasing the number of controllers on the bus. I then realized that the data I had provided you did not exactly match the values you had measured. My Current Test Protocol:On my 500K CAN bus, I currently have:
Benchmarking SetupTo benchmark the setup, I started by using a Python script. Here is a brief description:
I tested this script for commands A2, B1, 9A, 9B, and 9C. Here are the statistics obtained:
Unfortunately, they are quite different from the statistics I had sent you yesterday. Revised Wireshark AnalysisI therefore reviewed my Wireshark analysis and rethought my calculation method. Here is a brief description of the Python script:
Although far from perfect, the results show that the latency times I had communicated to you yesterday are actually only the motor processing times. Initial StatisticsHere are the statistics extracted during the use of the benchmark scripts I used previously:
Analysis of a
|
Hmmm, I see. Interesting... My set-up is different: I run |
Although the X8-Pro V2 and V3 do not share the same controller board (MC-X-300-O / MC-X-500-O), their SIP is the same and is an SPD1188 from Spintrol. I am attaching an excerpt of the PGA motor specifications, which provides the manufacturer's settling times: http://xuanzhi.webhh.net/index/index/product2/id/29.html?lang=en |
Hello,
I have been using your SDK since late 2023 and have also adapted a hardware interface for ROS2_Control. Given the high quality of your code, I took the liberty of forking it and adapting a controller that publishes
motor_status 1
andmotor_status 2
information on a topicmyactuator_rmd_status
, similar to thejoint_state_broadcaster
.The main modifications are as follows:
myactuator_rmd_interface
: Contains the message structures used by themyactuator_rmd_broadcaster
topic.myactuator_rmd_state_broadcaster
: Functions similarly to thejoint_state_broadcaster
. It queries thestate_interfaces
of the hardware interface to publish this data on the/myactuator_rmd_broadcaster
topic.myactuator_rmd_hardware
: Slightly modified to retrieve and return additional information frommotor_status 1
and3
.The published data includes:
rmd_brake
rmd_current
rmd_current_phase_a
rmd_current_phase_b
rmd_current_phase_c
rmd_error_code
rmd_temperature
rmd_voltage
Having adapted this code to your main branch, I am submitting this pull request.
Thank you for considering this contribution. I am available for any questions or clarifications.
Best regards,