[FEAT] Publish robot control mode - #1919
Conversation
|
I've put my own name on the copyright line since I'm contributing personally; happy to change it if you'd prefer a different attribution. |
|
This is definitively going in the right direction. To answer your questions:
Yes, absolutely. Sorry that I was imprecise in my task description.
We can do both, but they are independent of each other. Let's start with adding the constants in the message for now.
I think it would be good if it lived inside the message, yes.
This is definitively a valid concern. This will lead you with the issue of thread synchronization, though. One idea would be to keep the non-double buffer inside an atomic variable, so inside On the same thing: When we add the controller to the standard set we can have it running as an async controller with it's custom rate. Then, we can also remove the |
Partial implementation of #1658. Step 1-3.5 of the plan. Opening as a draft to check direction before I do the message and finish the broadcaster.
Content
RobotModeData is read from the primary client in read() and control_mode exposed as gpio/robot_control_mode.
Verified in URSim, 0 at rest, 1 in freedrive, 2 in force mode.
However I have 4 questions:
getRobotModeData()rather thangetRobotMode(), so the broadcaster can fill the wholeRobotModeDataMsgfrom one call. Also robot_mode alone is already on gpio/robot_mode from RTDE. Does that match your intent?ur_msgs/RobotModeDataMsg?getRobotModeData()returns null until the first package arrives, so I need a "not received yet" value. Currently a local CONTROL_MODE_UNKNOWN_ = 255. Should that live in RobotModeDataMsg instead so consumers can test for it?To do
RobotModeDataMsg fields + constants, ur_robot_mode_broadcaster, docs, tests, example, real-hardware check.