-
Notifications
You must be signed in to change notification settings - Fork 16
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
Create3 Fails to run consecutive rotate goals with RCLPY ROS2 #351
Comments
I have updated my Create3 with the newest H.1.0 firmware and the issue remains. Same behavior as before. I also tested it with a synchronous send goal call and it stops working just like before with the same log messages. |
Hi @Jacob-Friedberg, As a temporary solution, we recommend you to change RMW from Fast-rtps to cyclonedds. |
Great! I'm glad it's being worked on. However, i would like to mention that the RMW that I'm using on both the create3 and my laptop is cyclonedds already. Did you mean i should swap to fast-rtps? If not then this issue exists on cyclonedds as well |
Interesting. There may be an additional bug specific to the rotate goal action. |
….2.4 Release G.5.4 / H.2.4 # Changelog (from G.5.3/H.2.3) ## Core Robot ### Webserver * Add beta feature to disconnect from wlan0 and forget the SSID (#110) ### Power Management * Robot will now change its light ring to "spinning red" when the battery level dips below 3%, and will explicitly call the /robot_power service when it falls below 2%. ## ROS 2 ### Actions * The /rotate_angle action no longer accepts overriding goals; an ongoing goal must be completed (successfully or unsuccessfully) before a new goal will be accepted. (#351) * Improve reliability of robot docking and undocking.
Discussed in #350
Originally posted by Jacob-Friedberg March 9, 2023
ATTENTION: To run this code you MUST be on XORG/X11 the pynput library DOES NOT WORK on Wayland
System Info
Operating System: Kubuntu 22.04
Kernel Version: 5.15.0-67-generic (64-bit)
Graphics Platform: X11
Python Version: 3.10.6 (64-bit)
ROS Info
ROS_DISTRO=Humble
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
Create3 Info
Firmware Version: H.0.0
ROS 2 Domain ID: 0
RMW_IMPLEMENTATION:rmw_cyclonedds_cpp
Application Ros2 Parameters file:
Hello,
I am running into some issues sending repeated rotate goal commands to the create 3 using RCLPY. The code that I am running is pasted below:
I am creating a multi threaded executor with 2 threads and adding a node i created called slash which contains a subscriber for the hazard vector and several action clients for sending goals. both the subscriber and action client are created using separate mutually exclusive groups so they should be able to run concurrently with each other(action client doing stuff while the hazard vector subscriber is being serviced) . The subscriber for the hazard vector is used to cancel the current goal if a bump is detected.
I am using a lock to gain mutually exclusive access to the goal_uuid and to prevent the sendRotateGoal and sendDriveGoal functions from executing at different points in their functions if the subscriber for the hazard vector detects a bump and is currently cancelling the goal. Mainly its to prevent sending a goal while cancelling or messing with the goal_uuid until after we are finished cancelling the current goal.
I am using the goal status enum to check the goal_uuid.status of running and canceling goals as defined here:
https://docs.ros2.org/foxy/api/action_msgs/msg/GoalStatus.html
The sequencer for actions being sent to the Create3 is in the drive_away function in the slash Node. This function is called from the KeyCommander object that exists in a different thread than Main or the executor for RCLPY and uses pynput to read keyboard inputs to more easily run functions from the same terminal RCLPY runs in. Both of these src files are attached below:
Rotate_issue_src.zip
When the 'r' key is pressed the function begins as expected. The Create 3 undocks, then moves 1 meter away.
After that we enter a loop to create a new RotateAngle goal and setting the angle to be 3.14 and send the rotate goal.
This is where the issues start. The first time we send the create3 a rotate goal it will successfully rotate. The second time a rotate goal is sent usually the create3 will just sit there and do nothing(sometimes on a fresh restart application it will do 2 in a row but will fail on the third). I can see from a printout of the goal_uuid.status that occurs every 5 seconds if the goal is taking to long to finish that the status is STATUS_EXECUTING. The robot will remain stuck like this unless I cancel the current goal by tapping the bumper. When i tap the bumper the goal is cancelled as expected and the goal_uuid.status updates properly to be STATUS_CANCELED. The loop will continue, and the Create3 will do 1 rotate iteration just fine but the next one will fail in the exact same way as mentioned prior. For me this issue is repeatable as can be seen in the screenshot below:
Full Dump of the create3 logs:
messages.txt
Partial dump of the test run:
Looking at the logs for the create3 for these actions we can see that the rotate goals are received
[create3_05F8.motion_control]: Received new rotate_angle goal
but get stuck on this log message:
[create3_05F8.motion_control]: rotate_angle goal with angle 3.140000, max_speed 1.900000, per wheel 221
The Rotate goals that succeed have these following messages:
Interestingly, in my testing i found that this issue occurs so far with just multiple rotate goals in a row. If you have a loop containing a bunch of drive goals they work as expected and all execute for every iteration. I also found that if you rotate once, then perform a drive goal the create3 will drive and rotate for all iterations of the loop as normal.
All of this leads me to believe there may be an issue with the RotateAngle action server on the create3. Somewhere I think things are getting locked up on the create3 for consecutive rotate goals. The goal_uuid_status for the consecutive rotate goal seems to be set properly as executing, but the mobility monitor message never appears in the log and the create3 just sits idle until the goal is cancelled.
Let me know if you need more info from me to try and fix this issue.
I have not tested this issue yet on the new H.1.0 firmware, but will and report back the results.
The text was updated successfully, but these errors were encountered: