Embedded system and device applied to sensor triggering and time synchronization
Through the control signal generation module and synchronization channel board of the embedded system, the synchronous triggering and time synchronization of multiple sensors are realized, which solves the time accuracy and delay problems of the multi-sensor time acquisition system and provides unified and easy-to-use time synchronization and trigger control. , which improves the sensor collaborative operation capabilities of the robot operating system.
Patent Information
- Application Number
- CN202410779192.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-15
AI Technical Summary
In the existing technology, the absolute time accuracy error of the multi-sensor time acquisition system is large, and the multi-sensor data synchronization acquisition delay is large, and the acquisition time of different sensors cannot be effectively coordinated, resulting in time errors and interference.
An embedded system is designed, including a control signal generation module, a sensor trigger module and a time synchronization module. By generating target trigger waveforms and synchronization waveforms, the synchronous triggering and time synchronization of multi-channel sensors are realized, using signal amplification circuits and synchronization channel boards. Unified control of sensors and lidar, providing unified and easy-to-use time synchronization and trigger control.
It achieves absolute time accuracy and low-latency synchronous acquisition of multiple sensors, reduces time errors and interference between different sensors, provides a unified interface suitable for robot operating systems, and simplifies sensor time synchronization and trigger control.
Smart Images

Figure CN118784128A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot technology, and in particular to an embedded system and device applied to sensor triggering and time synchronization. Background Art
[0002] In the field of robotic systems, there are various types of sensors, such as visual cameras, lidars, depth cameras, event cameras, ultrasonic radars, millimeter-wave radars, etc. In order to make different types of sensors work together, it is necessary to trigger the sensors or synchronize the time in a certain way to coordinate the acquisition time of different sensors. For visual cameras, each camera is required to collect at the same time to eliminate the time error between sensors and improve the effect of tasks such as visual positioning and image stitching. For active sensors such as ultrasonic radars and lidars, the timing of each sensor emitting ultrasonic or laser search beams is coordinated to avoid mutual interference between different sensors.
[0003] In order to achieve time synchronization of multiple sensors of the robot, it is necessary to control the multi-source data of each sensor to be unified on the same time base. The unification of the time base needs to ensure that the absolute time accuracy of the acquisition system is within a certain error range and that multi-sensor data can be synchronously acquired with ultra-low latency. Summary of the invention
[0004] In view of the shortcomings of the prior art mentioned above, the purpose of the present invention is to provide an embedded system and device for sensor triggering and time synchronization, which can solve the problems of large absolute time accuracy error in multi-sensor time acquisition systems and large delay in synchronous acquisition of multi-sensor data.
[0005] To achieve the above-mentioned object and other related objects, the present invention provides an embedded system for sensor triggering and time synchronization, comprising:
[0006] A control signal generating module, used for acquiring a synchronous trigger configuration, and generating a target trigger waveform and a target synchronous waveform according to the synchronous trigger configuration;
[0007] A sensor trigger module, used to synchronously trigger the multi-channel sensors according to the target trigger waveform, so that the multi-channel sensors collect data at the same time;
[0008] A time synchronization module is used to synchronize the laser radar according to the target synchronization waveform.
[0009] In one embodiment of the present invention, the control signal generating module includes:
[0010] An initial signal generation submodule, used for generating a trigger waveform and a synchronization waveform according to the synchronization trigger configuration;
[0011] The signal amplification submodule is used to amplify the trigger waveform and the synchronization waveform to obtain a target trigger waveform and a target synchronization waveform.
[0012] In one embodiment of the present invention, the control signal generating module includes:
[0013] A parameter extraction submodule, used to extract configuration parameters from the synchronization trigger configuration;
[0014] A digital waveform generation submodule, used to generate a digital waveform according to the configuration parameters;
[0015] The analog waveform generation submodule converts the digital waveform into an analog waveform; wherein the analog waveform includes a target trigger waveform and a target synchronization waveform.
[0016] In one embodiment of the present invention, the digital waveform generation module includes:
[0017] a digital square wave waveform generation submodule, for generating a digital square wave waveform according to the configuration parameters when the configuration parameters are used to generate a square wave signal;
[0018] The digital synchronization waveform generation submodule is used to generate a digital synchronization waveform according to the configuration parameters when the configuration parameters are used to generate a GPS synchronization signal.
[0019] In one embodiment of the present invention, the analog waveform generation module includes:
[0020] The trigger waveform generation submodule is used to call the first generation function to convert the digital square wave waveform into a trigger waveform:
[0021] The synchronization waveform generation submodule is used to call the second generation function to convert the digital synchronization waveform into a synchronization waveform.
[0022] In one embodiment of the present invention, the control signal generating module further includes: a waveform sending module, which is used to call a sending function to send the trigger waveform and the synchronization waveform to the corresponding sensor and laser radar respectively.
[0023] In one embodiment of the present invention, the control signal generating module further includes:
[0024] A first storage module, used for storing the trigger waveform and the synchronization waveform in a temporary storage area;
[0025] The second storage module is used to store the waveform in the temporary storage area into the buffer pool after calling the storage function.
[0026] In an embodiment of the present invention, the control signal generating module further includes: an external button detecting module, which is used to monitor the level change of the external button and generate a system message according to the level change.
[0027] To achieve the above-mentioned purpose and other related purposes, the present invention also provides an embedded device for sensor triggering and time synchronization, including: a synchronization channel board, a control board:
[0028] The control board is used to receive a synchronous trigger configuration, and generate a target trigger waveform and a target synchronous waveform according to the synchronous trigger configuration;
[0029] The synchronization channel board is used to connect with the sensor and the laser radar, and sends a target trigger waveform and a target synchronization waveform to the sensor and the laser radar respectively to achieve synchronization triggering and time synchronization.
[0030] In one embodiment of the present invention, the synchronization channel board includes a signal amplification circuit, and the signal amplification circuit is used to amplify the trigger waveform and the synchronization waveform generated according to the synchronization trigger configuration to obtain a target trigger waveform and a target synchronization waveform.
[0031] The present invention provides unified and easy-to-use time synchronization and trigger control for sensors, and provides a unified interface suitable for the communication middleware of the robot operating system, which can facilitate the control of time synchronization and triggering of sensors on the robot without having to process the underlying time synchronization or trigger signal protocol; and provides multiple synchronization channels. Sensor devices with different synchronization channels are connected to different synchronization channels to obtain different trigger signals, thereby offsetting the differences between different devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of the structure of an embedded device for sensor triggering and time synchronization;
[0033] Figure 2 A schematic diagram of a single channel amplifier circuit provided by the present invention;
[0034] Figure 3 This is a schematic diagram of the functional modules of the embedded system for sensor triggering and time synchronization provided by the present invention.
[0035] In the figure: 1, synchronization channel board; 2, control board; 300, embedded system applied to sensor triggering and time synchronization; 301, control signal generation module; 302, sensor triggering module; 303, time synchronization module. DETAILED DESCRIPTION
[0036] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0037] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present invention in a schematic manner, and thus the illustrations only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0038] First, the background of the prior art is introduced. At present, most sensors in the field of robotics provide trigger control or time synchronization functions. Among them, trigger control is further divided into hardware trigger and software trigger; software trigger is usually performed through the data link of the sensor, and its delay will be affected by the sensor data transmission and the operation of the driver, and the time accuracy is not stable; robotic systems that require higher time accuracy usually use hardware trigger, that is, by sending electronic signals (such as square waves) to specific hardware ports to control the time of sensor trigger.
[0039] Different types of sensors may operate in different frequency ranges. For example, the capture frequency of an image sensor generally does not exceed 60 frames per second, while the capture frequency of an IMU (Inertial Measurement Unit) may exceed 400Hz. Depending on the design of the sensor, some sensors are triggered and collect data when a falling edge is detected, some are triggered and collect data when a rising edge is detected, and some are triggered at both the rising and falling edges. After receiving the trigger signal, the sensor will collect data after a very short delay. The length of this "signal-collection" delay may be different for different sensors.
[0040] In order to synchronize the time when different sensors capture data as much as possible, signals with different phases can be used to trigger the sensors, that is, the trigger edge is advanced or delayed by a corresponding time to offset the effect of the "signal-acquisition" delay. Different sensors may operate at different logic levels, of which 3.3V and 5V are more common levels. Some sensors require that the signal remain at the trigger level for no shorter or longer than a period of time, and the duty cycle of the square wave needs to be controlled to meet the requirement.
[0041] The time synchronization function can also be divided into electronic signal synchronization and software synchronization. The typical electronic signal synchronization is GPRMC+PPS synchronization, which is used in lidar. GPRMC is the time information (accurate to seconds) sent through the serial port, supplemented by the PPS (pulse per second) signal to determine the exact start time of the aforementioned seconds; software time synchronization is usually performed using network adapters and switches that support the IEEE1588 (PTP) protocol, and does not involve electronic signal transmission on dedicated ports.
[0042] The Robot Operating System (ROS) is a commonly used software architecture in the field of robotics. The sensor control and data acquisition driver software is adapted to the Robot Operating System. With the Robot Operating System, the control software can communicate with the robot software including the sensor driver software.
[0043] For example, the Robot OS topic message type is suitable for one-way information transmission, where a single ROS node can publish messages and multiple Robot OS nodes can receive messages. The specific time of the trigger signal is important information and needs to be sent through the Robot OS topic for the driver or other control program connected to the sensor to subscribe to it. The Robot OS service message type is suitable for two-way information transmission, where one Robot OS node sends a request or instruction to another Robot OS node and finally gets a response. Trigger and time synchronization are based on the Robot OS service, and the trigger and time synchronization are set by the robot control software.
[0044] Different types of sensors in the field of robotics have different time synchronization or triggering methods (square wave, GPRMC+PPS, PTP protocol (ie, IEEE 1588)), but the current technology lacks a unified and easy-to-use time synchronization and trigger control service; and because different models of sensors and different individuals of the same model of sensors have different times from receiving the trigger signal to actually capturing the signal, the existing technology cannot synchronize the sensors through a simple unified signal.
[0045] In order to solve the above problems, the present invention proposes an embedded system for sensor triggering and time synchronization, which provides unified and easy-to-use time synchronization and triggering control for sensors, and provides a unified interface suitable for the robot operating system communication middleware, which can facilitate the control of sensor time synchronization and triggering on the robot without having to process the underlying time synchronization or trigger signal protocol; and provides multiple synchronization channels. Sensor devices with different synchronization channels are connected to different synchronization channels to obtain different trigger signals, thereby offsetting the differences between different devices.
[0046] See also Figure 1As shown, the present invention provides an embedded device applied to sensor triggering and time synchronization, including: a synchronization channel board 1 and a control board 2.
[0047] The control board 2 is used to receive a synchronous trigger configuration, and generate a target trigger waveform and a target synchronous waveform according to the synchronous trigger configuration.
[0048] Furthermore, the synchronization channel board 1 includes a signal amplifying circuit, and the signal amplifying circuit is used to amplify the trigger waveform and the synchronization waveform to obtain a target trigger waveform and a target synchronization waveform.
[0049] The synchronization channel board 1 is also used to connect with the sensor and the laser radar, and send the target trigger waveform and the target synchronization waveform to the sensor and the laser radar respectively to achieve synchronization triggering and time synchronization.
[0050] The present invention can use an embedded computer as a control board 2, and use a printed circuit board PCB, a surface mount MOS tube, a resistor, a connector, etc. to form a synchronous channel board 1. The embedded computer is used for the robot operating system, connecting to Ethernet, and providing a sufficient number of GPIO ports to generate and send multi-channel trigger signal waveforms. The robot control system runs on the embedded computer, communicates with the robot control software and the sensor driving software through the robot operating system, and sets the trigger and time synchronization according to the requirements of the robot control software to generate and send the trigger and time synchronization waveforms.
[0051] In the embodiment of the present invention, the signal amplification circuit is composed of field effect transistors, which can convert the logic level used by the control board 2 into the output level required by the sensor. The synchronous channel board 1 is connected to the signal cable using a connector to provide a trigger signal to each sensor. The synchronous channel board 1 has multiple connectors, providing multiple trigger signals and time synchronization channels, and each connector can be connected to multiple sensors.
[0052] The connector can be connected to different synchronization signal cables and connected to various types of sensors. Each trigger signal channel has two groups of electronic signal ports, one group as a signal ground port, and the other group as a trigger signal output port. Each time synchronization signal channel has three groups of electronic signal ports, the first group as a signal ground port, the second group as a GPRMC signal output port, and the third group as a PPS signal output port.
[0053] In an actual application scenario of the present invention, the synchronous channel board 1 can provide 13 trigger signal channels, each of which is composed of a GPIO port, a set of signal amplification circuits, and a number of connection sockets. Figure 2The figure shows the schematic diagram of the amplifier circuit for a single channel. Q7 is an AO3401 PMOS tube, Q8 is an AO3400 NMOS tube, the IN port is connected to the GPIO, the OUT port is connected to the output connector, and LINE_PWR is the signal power supply, which can select 3.3V or 5V as the output level.
[0054] When GPIO is at a low level, the gate of the NMOS tube is connected to the source through resistor R14 and grounded, Vgs=0, the NMOS tube is turned off, and the drain is floating; the gate of the PMOS tube is connected to the drain of the NMOS tube, and the source is connected to the signal power supply; the gate of the PMOS tube is connected to the source through resistor R12, when the gate is floating, Vgs=0, the PMOS tube is turned off; the OUT end, that is, the drain of the PMOS tube is grounded through resistor R13, and the output is a low level.
[0055] When GPIO is at a high level, a positive potential difference is formed between the gate and source of the NMOS tube through resistor R14, Vgs>0, the NMOS tube is turned on, and the drain is grounded through the source, that is, the gate of the PMOS tube is grounded; a negative potential difference is formed between the gate and source of the PMOS tube through resistor R12, Vgs<0, and the PMOS tube is turned on; the OUT end is connected to the signal power supply through the PMOS tube and outputs a high level.
[0056] In another optional embodiment of the present invention, an external button socket is also provided on the synchronization channel board 1, which provides power supply, grounding, external button port and external button LED indicator port respectively. Two LED indicators are arranged on the synchronization signal board 1, which respectively indicate the power status and the PPS status of the time synchronization channel.
[0057] Specifically, the synchronous channel board 1 detects whether the external button connected to the socket is pressed or released, and sends a button signal through the robot operating system to enable the robot control software corresponding to the control board 2 to control. The synchronous channel board 1 then turns on or off the LED indicator on the button according to the command sent from the robot control system.
[0058] The robot control system of the present invention can store synchronous trigger configuration, serial data configuration and external button configuration in global variables.
[0059] Specifically, the structure variable struct line_config is used to store the synchronous trigger settings of a single channel, where the variable int num stores the channel number; int gpio stores the Raspberry Pi GPIO port number corresponding to the channel; bool enabled indicates whether this channel participates in the synchronous trigger; int trigger_type stores the trigger edge type of the channel, RISING_EDGE indicates that the trigger edge is the rising edge, FALLING_EDGE indicates that the trigger edge is the falling edge, and EITHER_EDGE indicates that both the rising edge and the falling edge are triggered; unsigned freq indicates the trigger frequency of the channel in one second, and this frequency indicates the number of trigger edges contained in the square wave per second; unsigned every_n_seconds indicates how many seconds the channel sends a square wave signal; for the case where the required trigger frequency is faster than 1Hz, freq will be set to the required trigger frequency, and every_n_seconds will be set to 1. For the case where the required trigger frequency is slower than 1Hz, freq will be set to 1, and every_n_seconds will be set to the integer after the reciprocal of the required trigger frequency is rounded, that is, a trigger is performed every integer second; unsigned offset_us represents the trigger phase delay in microseconds, which shall not exceed one trigger cycle. int duty_cycle_percent represents the duty cycle of the square wave signal in percentage. This percentage multiplied by the trigger cycle is the duration that the channel remains at the trigger level. When the trigger edge is set to EITHER_EDGE, this variable does not affect the actual trigger setting, and the actual duty cycle will be 50%.
[0060] In an actual application scenario of the present invention, the synchronization signal sending system in the synchronization channel board 1 can provide 12 configurable synchronization trigger channels, and the array struct line_config sync_lines[GP_LINE_COUNT] stores the trigger settings of the 12 channels.
[0061] The structure variable struct gprmc_config stores the configuration of the serial data channel, where the variable int gpio represents the Raspberry Pi GPIO port number corresponding to the channel; unsigned baud represents the baud rate of the serial data, with valid values of 9600, 14400, 19200, 38400, 56000, 57600, 115200, and the default value is 9600; unsigned offset is the delay between the start time of serial timestamp sending and the start time of each second; bool inverted indicates whether to use the inverted level to send serial timestamp data.
[0062] The serial data channel is configured with a data format of 1 start bit, 8 data bits, and 1 stop bit. The variable intbtn_led_mode stores the display mode of the external button LED indicator, where BTN_LED_OFF means the indicator is off, BTN_LED_ON means the indicator is on, and BTN_LED_BLINK_1HZ means the indicator flashes once per second.
[0063] See also Figure 3 As shown, the present invention proposes an embedded system 300 for sensor triggering and time synchronization, the system comprising:
[0064] The control signal generating module 301 is used to obtain a synchronous trigger configuration, and generate a target trigger waveform and a target synchronous waveform according to the synchronous trigger configuration.
[0065] In an embodiment of the present invention, the control signal generating module 301 includes: an initial signal generating submodule, used to generate a trigger waveform and a synchronization waveform according to the synchronization trigger configuration; a signal amplifying submodule, used to amplify the trigger waveform and the synchronization waveform to obtain a target trigger waveform and a target synchronization waveform.
[0066] In an embodiment of the present invention, the control signal generating module 301 includes: a parameter extraction submodule, used to extract configuration parameters from the synchronization trigger configuration; a digital waveform generating submodule, used to generate a digital waveform according to the configuration parameters; an analog waveform generating submodule, converting the digital waveform into an analog waveform; wherein the analog waveform includes a target trigger waveform and a target synchronization waveform.
[0067] Specifically, the digital waveform generation module includes: a digital square wave waveform generation submodule, which is used to generate a digital square wave waveform according to the configuration parameters when the configuration parameters are used to generate a square wave signal; and a digital synchronization waveform generation submodule, which is used to generate a digital synchronization waveform according to the configuration parameters when the configuration parameters are used to generate a GPS synchronization signal.
[0068] In detail, the analog waveform generation module includes: a trigger waveform generation submodule, which is used to call a first generation function to convert the digital square wave waveform into a trigger waveform; and a synchronization waveform generation submodule, which is used to call a second generation function to convert the digital synchronization waveform into a synchronization waveform.
[0069] Furthermore, the control signal generating module 301 also includes: a waveform sending module, which is used to call a sending function to send the trigger waveform and the synchronization waveform to the corresponding sensor and laser radar respectively.
[0070] Furthermore, the control signal generating module 301 also includes: a first storage module, used to store the trigger waveform and the synchronization waveform in a temporary storage area; a second storage module, used to store the waveform in the temporary storage area into a cache pool after calling a storage function.
[0071] In an embodiment of the present invention, the system runs once per second, calls the gpioWavePrepare1sec function according to the synchronization trigger configuration to generate the synchronization signal waveform of all channels in the next second, calls the sending function gpioWaveTxSend function at 0 microseconds in the next second to send the waveform to the sensor or lidar, and publishes the trigger timestamp of the corresponding channel to each topic through the publish method of the ros::Publisher class.
[0072] Specifically, the gpioWavePrepare1sec function is used to generate digital signals and mainly consists of three parts:
[0073] The first part is the square wave generation of the general synchronous trigger channel: read the synchronous trigger configuration sync_lines[], pass the configuration information line_config of each general trigger signal channel to the gpioWaveAddFreq1sec function, and generate the waveform of a single channel respectively.
[0074] The second part is the level generation of the external button LED indicator. It reads the configuration variable btn_led_mode and, according to the corresponding mode, calls the gpioWrite function to set the corresponding GPIO port to maintain a high or low level, or calls the gpioWaveAddFreq1sec function to generate the square wave waveform required to flash once per second.
[0075] The third part is the generation of the GPS synchronization signal of the lidar: the PPS port, that is, the square wave on the non-universal synchronization trigger channel is generated by calling the gpioWaveAddFreq1sec function; the GPS port, that is, the GPRMC format message of the serial data timestamp port is generated by calling gpioWaveAddGprmc.
[0076] The waveforms generated by the above three parts first enter the waveform generation temporary storage area provided by the pigpio protocol stack. After calling the gpioWaveCreatePad function, the waveforms in the temporary storage area are merged, converted, and stored in the hardware buffer pool of the Raspberry Pi GPIO controller by pigpio, and a waveform serial number is generated.
[0077] The first generation function gpioWaveAddFreq1sec function in the embodiment of the present invention generates a square wave of a single channel according to the specified parameters. Specifically, the accepted parameters are int gpio output port number, int trigger_type trigger edge type, unsigned freq trigger frequency, unsigned offset_us trigger phase delay, int duty_cycle_percent duty cycle, covering all properties required to generate a square wave.
[0078] Through function overloading, gpioWaveAddFreq1sec also accepts line_config structure variable parameters. The function first calculates the total number of triggers and cycle length, specifies the initial level of the GPIO port at the 0th microsecond, and then sequentially calculates the level change mode and change time involved in each trigger. Each level change will be described in the gpioPulse_t variable format of the pigpio library. All level changes within one second form a square wave waveform and are stored in the gpioPulse_t[]pulses array. Finally, by calling the function gpioWaveAddGeneric, the waveform of this single channel is stored in the waveform generation temporary storage area provided by the pigpio protocol stack.
[0079] For example, for a square wave with the trigger edge set to RISING_EDGE, the level changes from low to high at the trigger moment, and after the trigger level is maintained for a period of time equal to the duty cycle multiplied by the cycle length, the level changes from high to low. When the trigger edge is set to FALLING_EDGE, the level changes in the opposite direction. When the trigger edge is set to EITHER_EDGE, the port level changes up and down at the trigger moment, and maintains the level state until the next trigger.
[0080] Furthermore, the second generation function gpioWaveAddGprmc function generates and sends a GPRMC message that complies with the NMEA0183 standard according to specified parameters, and the laser radar obtains a timestamp from the message for time synchronization.
[0081] The GPRMC message consists of a "$GPRMC" message header, 12 fields separated by commas, and a checksum starting with "*". The first field is the UTC time in the format of hhmmss.ssss, where hh is the hour in the 24-hour system, mm is the minute, and ss.ssss is the second and the number of seconds after the decimal point. The second field is the positioning status, "A" indicates successful positioning, and "V" indicates invalid positioning information. The ninth field is the UTC date in the format of DDMMYY, where DD is the date, MM is the month, and YY is the last two digits of the year. The twelfth field is the positioning mode, "A" indicates automatic positioning. The checksum is the XOR sum of all characters between "$" and "*". The gpioWaveAddGprmc function accepts a timestamp in the UTC time zone, converts it to a date and time, and fills it into fields 1 and 9. It fills "A" in fields 2 and 12 to indicate that the data is valid, fills in placeholder data that meets the format requirements in other fields, and then calculates the checksum to get a complete GPRMC message.
[0082] The GPRMC message, together with the baud rate setting and delay setting of the serial data, is passed to the gpioWaveAddSerial function or the gpioWaveAddSerialInverted function. The pigpio protocol stack generates a serial data waveform and stores it in the temporary storage area for subsequent operations.
[0083] Among them, the gpioWaveAddGprmc function accepts unsigned gpio output port number, unsigned baud rate, unsigned offset delay time, time_ttimestamp UTC time zone timestamp, int inverted level inversion setting, a total of 5 parameters. Through function overloading, it also accepts gps_config structure variables.
[0084] In the embodiment of the present invention, the digital square wave waveform generation module further includes: a timestamp determination module, configured to determine whether to generate a digital square wave waveform according to a timestamp difference in the configuration parameters.
[0085] For example, for a general synchronous trigger channel with a trigger frequency less than 1Hz, the gpioWavePrepare1sec function determines whether to generate a square wave signal for the corresponding channel within the current second by calculating the difference between the current timestamp and the start timestamp. After gpioWavePrepare1sec generates waveforms for all channels to the pigpio protocol stack temporary storage area. At 0 microseconds of the next second, the gpioWaveTxSend function is called to send the waveform, and the trigger timestamp of the corresponding channel is published to each topic through the publish method of the ros::Publisher class.
[0086] Each general trigger channel of the synchronization signal sending system in the synchronization channel board 1 has a corresponding ROStopic, which publishes the trigger time of this channel. Since the waveform prepared by the gpioWavePrepare1sec function is stored in the sending buffer pool of the Raspberry Pi GPIO hardware, the trigger time of all channels in the next second has been determined, so the synchronization signal sending system will broadcast all trigger times in the next second through the ROS topic at the 0th microsecond of the next second, instead of waiting for each trigger to occur before broadcasting. This ensures that each trigger corresponds to a topic timestamp information (broadcast within the last 1 second), and enables the system to have sufficient, non-fragmented time to generate waveforms, and send them at the exact 0th microsecond of each second, without being preempted by a large number of ROS message sending tasks, minimizing the impact of non-real-time operating systems on time accuracy.
[0087] Furthermore, the control signal generating module 301 further includes: an external button detecting module, which is used to monitor the level change of the external button and generate a system message according to the level change.
[0088] By calling the gpioSetAlertFunc function, the level change of the GPIO port connected to the external button is monitored by the Raspberry Pi hardware. When the button is pressed, the port will detect the rising edge of the level, and when the button is released, the port will detect the falling edge of the level. These level change events are passed to the button_callback callback function, which generates corresponding ROS messages and sends them to the ROS topic / syncboard / button for reference by the robot control software.
[0089] In order to eliminate the influence of level jitter caused by virtual connection of button on event judgment, the gpioGlitchFilter function is used to set jitter filtering for the GPIO port connected to the external button. Only stable level changes will be judged as real button events.
[0090] The present invention can provide 4 ROS services, which are respectively used to set the trigger channel, serial data channel, external button indicator light and general trigger switch. When the general trigger switch is turned off, all general trigger channels do not send trigger signals, the lidar channel still sends serial timestamp signals and PPS per second trigger signals, the external button LED indicator signal is still sent, and the external button trigger is still accepted. Whether the general trigger switch is turned on or not does not affect the setting of the general trigger channel. The trigger parameters of each channel can be set first and then the general trigger switch can be turned on to make all sensors start working at the same time. The trigger settings of the channel can also be modified after the general trigger switch is turned on and each channel is triggered. The modified parameters will be used to generate a new waveform when the gpioWavePrepare1sec function is called next time. The generated waveform will be sent at the 0th microsecond of the next second, and the ROS topic of each channel will then publish a new trigger time.
[0091] The sensor trigger module 302 is used to synchronously trigger the multi-channel sensors according to the target trigger waveform, so that the multi-channel sensors collect data at the same time.
[0092] The time synchronization module 303 is used to perform time synchronization on the laser radar according to the target synchronization waveform.
[0093] The present invention first connects the sensor that needs hardware triggering and time synchronization to the synchronization signal board, and uses the robot operating system to set the corresponding trigger channel and time synchronization channel.
[0094] Then use the button on the synchronization signal board or send the trigger start command through the robot operating system. The synchronization signal board sends the square wave signal and GPRMC+PPS signal through the corresponding trigger channel and time synchronization channel. The control board 2 sends the actual trigger time of the trigger channel through the robot operating system.
[0095] The square wave signal on the trigger channel has a specific frequency, and the sensor will collect data at this frequency. The square wave signal has a specific polarity and duty cycle to meet the requirements of the specific model sensor for the trigger signal. The square wave signal has a specific phase to offset the delay between the sensor receiving the trigger signal and actually collecting the signal.
[0096] The GPRMC signal on the time synchronization channel has a specific baud rate and polarity to meet the requirements of the specific model sensor for the GPRMC signal. The GPRMC signal contains the current time information, and the PPS signal is sent at the beginning of each second to synchronize the sensor time.
[0097] Therefore, the present invention realizes the triggering and time synchronization of the sensor, and can return the actual triggering time through the robot operating system.
[0098] References throughout this specification to "one embodiment," "an embodiment," or "a specific embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention, and not necessarily in all embodiments. Thus, various appearances of the phrases "in one embodiment," "in an embodiment," or "in a specific embodiment" in different places throughout this specification do not necessarily refer to the same embodiment. In addition, the particular features, structures, or characteristics of any specific embodiment of the invention may be combined with one or more other embodiments in any suitable manner. It should be understood that other variations and modifications of the embodiments of the invention described and illustrated herein may be possible in light of the teachings herein and are to be considered part of the spirit and scope of the invention.
[0099] It should also be understood that one or more of the elements shown in the figures may also be implemented in a more separate or more integrated manner, or even removed because they are inoperable in certain circumstances or provided because they may be useful depending on the application.
[0100] In addition, unless otherwise explicitly indicated, any marking arrows in the drawings should be regarded as exemplary only and not limiting. In addition, unless otherwise indicated, the term "or" used herein is generally intended to mean "and / or". In the case where the term is not clear because it is anticipated that the ability to separate or combine is provided, the combination of components or steps will also be regarded as indicated.
[0101] As used in the description herein and throughout the claims that follow, "a", "an", and "the" include plural references unless otherwise indicated. Likewise, as used in the description herein and throughout the claims that follow, the meaning of "in" includes "in" and "on" unless otherwise indicated.
[0102] The above description of the illustrated embodiments of the present invention (including the contents described in the Abstract) is not intended to be an exhaustive list or to limit the present invention to the precise form disclosed herein. Although specific embodiments of the present invention and examples of the present invention are described herein for illustrative purposes only, various equivalent modifications are possible within the spirit and scope of the present invention as will be recognized and appreciated by those skilled in the art. As noted, these modifications may be made to the present invention in accordance with the above description of the embodiments described in the present invention, and these modifications will be within the spirit and scope of the present invention.
[0103] Systems and methods have been generally described herein as details that aid in understanding the present invention. In addition, various specific details have been given to provide an overall understanding of embodiments of the present invention. However, those skilled in the relevant art will recognize that embodiments of the present invention may be practiced without one or more of the specific details, or may be practiced using other devices, systems, accessories, methods, components, materials, parts, etc. In other cases, well-known structures, materials, and / or operations are not specifically shown or described in detail to avoid confusion with various aspects of embodiments of the present invention.
Claims
1. An embedded system for sensor triggering and time synchronization, characterized in that: The system comprises: A control signal generating module, used for acquiring a synchronous trigger configuration, and generating a target trigger waveform and a target synchronous waveform according to the synchronous trigger configuration; A sensor trigger module, used to synchronously trigger the multi-channel sensors according to the target trigger waveform, so that the multi-channel sensors collect data at the same time; A time synchronization module is used to synchronize the laser radar according to the target synchronization waveform.
2. The embedded system for sensor triggering and time synchronization according to claim 1, characterized in that: The control signal generating module comprises: An initial signal generation submodule, used for generating a trigger waveform and a synchronization waveform according to the synchronization trigger configuration; The signal amplification submodule is used to amplify the trigger waveform and the synchronization waveform to obtain a target trigger waveform and a target synchronization waveform.
3. The embedded system for sensor triggering and time synchronization according to claim 1, characterized in that: The control signal generating module comprises: A parameter extraction submodule, used to extract configuration parameters from the synchronization trigger configuration; A digital waveform generation submodule, used to generate a digital waveform according to the configuration parameters; The analog waveform generation submodule converts the digital waveform into an analog waveform; wherein the analog waveform includes a target trigger waveform and a target synchronization waveform.
4. The embedded system for sensor triggering and time synchronization according to claim 3, characterized in that: The digital waveform generation module comprises: a digital square wave waveform generation submodule, for generating a digital square wave waveform according to the configuration parameters when the configuration parameters are used to generate a square wave signal; The digital synchronization waveform generation submodule is used to generate a digital synchronization waveform according to the configuration parameters when the configuration parameters are used to generate a GPS synchronization signal.
5. The embedded system for sensor triggering and time synchronization according to claim 3, characterized in that: The analog waveform generation module comprises: The trigger waveform generation submodule is used to call the first generation function to convert the digital square wave waveform into a trigger waveform: The synchronization waveform generation submodule is used to call the second generation function to convert the digital synchronization waveform into a synchronization waveform.
6. The embedded system for sensor triggering and time synchronization according to claim 1, characterized in that: The control signal generating module further includes: a waveform sending module, which is used to call a sending function to send the trigger waveform and the synchronization waveform to the corresponding sensor and laser radar respectively.
7. The embedded system for sensor triggering and time synchronization according to claim 1, characterized in that: The control signal generating module also includes: A first storage module, used for storing the trigger waveform and the synchronization waveform in a temporary storage area; The second storage module is used to store the waveform in the temporary storage area into the buffer pool after calling the storage function.
8. The embedded system for sensor triggering and time synchronization according to claim 1, characterized in that: The control signal generating module further includes: an external button detecting module, which is used to monitor the level change of the external button and generate a system message according to the level change.
9. An embedded device for sensor triggering and time synchronization, comprising: Synchronous channel board, control board: The control board is used to receive a synchronous trigger configuration, and generate a target trigger waveform and a target synchronous waveform according to the synchronous trigger configuration; The synchronization channel board is used to connect with the sensor and the laser radar, and sends a target trigger waveform and a target synchronization waveform to the sensor and the laser radar respectively to achieve synchronization triggering and time synchronization.
10. The embedded device for sensor triggering and time synchronization according to claim 9, characterized in that: The synchronous channel board includes a signal amplifying circuit, and the signal amplifying circuit is used to amplify the trigger waveform and the synchronization waveform generated according to the synchronous trigger configuration to obtain a target trigger waveform and a target synchronization waveform.
