@@ -60,6 +60,29 @@ The `action_client/` directory contains examples of nodes that send goals to act
6060 - Cleanup and shutdown handling
6161- ** Run Command** : ` node action_client/action-client-cancel-example.js `
6262
63+ #### 3. Action Client Validation (` action-client-validation-example.js ` )
64+
65+ ** Purpose** : Demonstrates goal validation features for action clients.
66+
67+ - ** Action Type** : ` action_tutorials_interfaces/action/Fibonacci `
68+ - ** Action Name** : ` fibonacci `
69+ - ** Functionality** :
70+ - Schema introspection for action goal types
71+ - Client-level validation with ` validateGoals: true ` option
72+ - Per-goal validation override with ` { validate: true/false } `
73+ - Strict mode validation for detecting unknown fields
74+ - Reusable goal validators with ` createMessageValidator() `
75+ - Error handling with ` MessageValidationError `
76+ - ** Features** :
77+ - ** Goal Validation** : Catch invalid goals before sending to action server
78+ - ** Schema Introspection** : Use ` getMessageSchema() ` to inspect goal structure
79+ - ** Dynamic Toggle** : Enable/disable validation with ` setValidation() `
80+ - ** Detailed Errors** : Field-level validation issues with expected vs received types
81+ - ** Strict Mode** : Detect extra fields that don't belong in the goal
82+ - ** Reusable Validators** : Create validators for repeated goal validation
83+ - ** Run Command** : ` node action_client/action-client-validation-example.js `
84+ - ** Note** : Standalone example - demonstrates validation errors without requiring a running action server
85+
6386### Action Server Examples
6487
6588The ` action_server/ ` directory contains examples of nodes that provide action services:
@@ -216,6 +239,8 @@ int32[] sequence
216239- ** Feedback Handling** : Processing incremental updates during execution
217240- ** Result Processing** : Handling final results and status
218241- ** Goal Cancellation** : Canceling active goals with ` cancelGoal() `
242+ - ** Goal Validation** : Pre-send validation with ` validateGoals ` option and ` MessageValidationError `
243+ - ** Schema Introspection** : Programmatic access to action goal schemas
219244
220245#### Action Server Concepts
221246
@@ -260,19 +285,16 @@ All examples use ES6 classes to encapsulate action functionality:
260285### Common Issues
261286
2622871 . ** Action Server Not Available** :
263-
264288 - Ensure action server is running before starting client
265289 - Check that both use the same action name (` fibonacci ` )
266290 - Verify action type matches (` test_msgs/action/Fibonacci ` )
267291
2682922 . ** Goal Not Accepted** :
269-
270293 - Check server's ` goalCallback ` return value
271294 - Verify goal message structure is correct
272295 - Ensure server is properly initialized
273296
2742973 . ** Missing Feedback** :
275-
276298 - Confirm feedback callback is properly bound
277299 - Check server's ` publishFeedback() ` calls
278300 - Verify feedback message structure
0 commit comments