Skip to content

Commit d5ca030

Browse files
committed
uart definition
1 parent 31db357 commit d5ca030

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This library targets the communication between ROS and uPy with rosserial as mid
1616
## Installation
1717
Before using this library you must have ROS installed, as well as rosserial which would be with the following command:
1818

19-
`sudo apt install ros-<version>-rosserial`
19+
`sudo apt install ros-<version>-rosserial ros-<version>-rosserial-arduino`
2020

2121
In theory every board with the kind of generic `UART` class for ESP32 is capable of using this library, but it must be known exactly which `UART ID` is being used, this means for example, for ESP32 defined pins correspond to TX0 and RX0 for UART0, and so on. In the examples below, UART2 is used.
2222

@@ -105,10 +105,11 @@ while True:
105105
## Classes
106106
### `uros.NodeHandle`
107107
#### Constructor
108-
##### `uros.NodeHandle(serial_id, baudrate)`
108+
##### `uros.NodeHandle(serial_id = 2, baudrate = 115200, **kwargs)`
109109
Initiates the class which handles the node, advertised topics, publishes and subscribe.
110110
* `serial_id`: corresponds to the UART ID, in case of ESP32, it has 3 UARTS, in the examples UART2 is used.
111111
* `baudrate`: is the baudrate in which the board will communicate.
112+
* `**kwargs`: used in order to be able to define the serial communication with uart in different ways, in case a custom UART object is wanted to be used, it should be defined as `uros.NodeHandle(serial = uart_object)` or in case certain `tx` and `rx` pins are wanted for the uart with certain ID, it should be like `node = uros.NodeHandle(2, 115200, tx=16, rx= 16)`.
112113

113114
#### Methods
114115
##### `uros.NodeHandle.publish(topic_name, msg, buffer_size=1024)`

0 commit comments

Comments
 (0)