-
Notifications
You must be signed in to change notification settings - Fork 646
uorb: add generator tool #3215
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
uorb: add generator tool #3215
Conversation
e.g.: 1. uorb_generator -f /data/sensor/19700101000003/sensor_accel_uncal0.csv -t sensor_accel_uncal2 2. uorb_generator -s -r 5 -n 200 -t sensor_accel_uncal2 timestamp:1,x:-2.0,y:3,z:4,temperature:5 Signed-off-by: likun17 <likun17@xiaomi.com>
|
@Otpvondoiats please fix: |
replace kmm_zalloc with zalloc and malloc, and fix format and return value errors. Signed-off-by: likun17 <likun17@xiaomi.com>
Done |
|
@Otpvondoiats please read last comment from @acassis in your previously closed PR #3214 - in order to update a PR you do a forced push to your working branch and the same PR is updated automatically on GitHub, there is no need to close a PR and create a new one to update :-) lets go to the initial PR #3214, as there are many valuable code comments already, reopen and finish :-) what do you think @acassis ? :-) |
I think since already create a new PR and there is already review here, we can continue from here. @xiaoxiang781216 @Donny9 please instruct others developers how to use "git rebase -i", since Otpvondoiats is not the only one to do it. Others are also closing their PRs and opening new when someone add reviews |
The reason I closed this PR is that I plan to merge these two submissions into one. Donny9 suggested I keep these, but my own repository branch for the for loop has been deleted, so there will be two PR. |
The initial idea was to merge the two into one, so I deleted the cloud repository branch, and a new pull request would be generated when I pushed later. |
|
Okay, thanks @Otpvondoiats @acassis @xiaoxiang781216 :-) |
Summary
uorb_generator this tool can be used in conjunction with uorb_listener.
Before using the tool, it is necessary to set the CONFIG_LINE_MAX parameter to a sufficiently long length to ensure that the terminal can accept complete input data. A recommendation is to set it to 256 or 512.
Incoming data can be printed via uorb_listener or concatenated manually using format information, but it must be ensured that the string and struct information are consistent. Topics saved using uorb_listener -f can be pulled and imported into the simulator for debugging (mount -t hostfs -o fs=/home/xxx/ /data).
Parameter Description:
-f specifies the path to the input playback file. -n specifies the number of times to playback the data. This option is only effective when -s is enabled. -r specifies the playback frequency (in HZ, e.g., 5hz, 20hz). This option is only effective when -s is enabled. -t specifies the topic for playback, with the option to specify a specific instance value afterward. -s enables playback of simulated (fake) data, generating struct data from input entered via the terminal. It will modify the timestamp of the current data to real-time. Simulated data should be placed at the end of the entire command.
By following these instructions, users can effectively utilize the Generator debugging tool in conjunction with uorb_listener for system debugging and verification.
The tool publishes topic data via uorb.
Notice:LINE_MAX must be set to 128 or more.
generator [arguments...]
Commands:
<topics_name> The playback topic name.
[-h ] Listener commands help.
[-f ] File path to be played back(absolute path).
[-n ] Number of playbacks(fake model), default: 1
[-r ] The rate for playing fake data is only valid when parameter 's' is used.
default:10hz.
[-s ] Playback fake data.
[-t ] Playback topic.
Testing