Skip to content

Commit

Permalink
tutorial, main: simplify connections
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Klotzbuecher <mk@mkio.de>
  • Loading branch information
kmarkus committed Jul 16, 2020
1 parent 10d69da commit 17ba236
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/user/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ output ports, that are connected via two fifos:
.. literalinclude:: ../../examples/platform/platform_launch/main.c
:language: c
:lines: 168-177
:lines: 168-175
Init and Start the blocks
Expand All @@ -514,7 +514,7 @@ Lastly, we need to init and start all the blocks. For example, for the
.. literalinclude:: ../../examples/platform/platform_launch/main.c
:language: c
:lines: 190-194,225-228
:lines: 188-192,223-226
The same applies to all other blocks.
Expand All @@ -525,7 +525,7 @@ terminate, we can use ``ubx_wait_sigint`` to wait for the user to type
.. literalinclude:: ../../examples/platform/platform_launch/main.c
:language: c
:lines: 238,239
:lines: 236,237
Note that we have to link against pthread library, so the
*Makefile.am* has to be modified accordingly:
Expand Down
6 changes: 2 additions & 4 deletions examples/platform/platform_launch/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,8 @@ int main()
ubx_port_t* control1_commanded_vel = ubx_port_get(control1,"commanded_vel");
ubx_port_t* plat1_desired_vel = ubx_port_get(plat1,"desired_vel");

ubx_port_connect_out(plat1_pos,fifo_pos);
ubx_port_connect_in(control1_measured_pos,fifo_pos);
ubx_port_connect_out(control1_commanded_vel,fifo_vel);
ubx_port_connect_in(plat1_desired_vel,fifo_vel);
ubx_ports_connect(plat1_pos, control1_measured_pos, fifo_pos);
ubx_ports_connect(control1_commanded_vel, plat1_desired_vel, fifo_vel);

/* init and start blocks */
if(ubx_block_init(webif) != 0) {
Expand Down

0 comments on commit 17ba236

Please sign in to comment.