首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >如何从串口病态LMS200中读取数据?

如何从串口病态LMS200中读取数据?
EN

Stack Overflow用户
提问于 2015-10-02 20:20:33
回答 2查看 1.1K关注 0票数 2

我想通过串口读取病态LMS200激光雷达扫描仪的数据。我可以看到串行端口为/dev/ttyUSB0。我只是不知道如何从中获取数据。

我尝试过在Ubuntu14.04.3LTS下使用工具箱手册中所示的手动安装来安装The Sick LIDAR Matlab/C++ Toolbox

我解压了这个文件:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$tar -xzvf sicktoolbox-1.0.1.tar.gz

这就是我在运行./configure之后得到的结果(不确定它是否有用)

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
me@MyPC:~/smetiste/Sick/sicktoolbox-1.0.1$ ./configure 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for gnuplot... no
configure: WARNING: *** gnuplot not found, some examples will not be built.
checking for doxygen... no
configure: WARNING: doxygen not found - will not generate any doxygen documentation
checking for perl... /usr/bin/perl
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking linux/serial.h usability... yes
checking linux/serial.h presence... yes
checking for linux/serial.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking whether time.h and sys/time.h may both be included... yes
checking for int16_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking whether gcc needs -traditional... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking for gettimeofday... yes
checking for memset... yes
checking for select... yes
checking for socket... yes
checking for strcasecmp... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating c++/Makefile
config.status: creating c++/examples/Makefile
config.status: creating c++/examples/ld/Makefile
config.status: creating c++/examples/ld/ld_config/Makefile
config.status: creating c++/examples/ld/ld_config/src/Makefile
config.status: creating c++/examples/ld/ld_more_config/Makefile
config.status: creating c++/examples/ld/ld_more_config/src/Makefile
config.status: creating c++/examples/ld/ld_multi_sector/Makefile
config.status: creating c++/examples/ld/ld_multi_sector/src/Makefile
config.status: creating c++/examples/ld/ld_single_sector/Makefile
config.status: creating c++/examples/ld/ld_single_sector/src/Makefile
config.status: creating c++/examples/lms/Makefile
config.status: creating c++/examples/lms/lms_config/Makefile
config.status: creating c++/examples/lms/lms_config/src/Makefile
config.status: creating c++/examples/lms/lms_mean_values/Makefile
config.status: creating c++/examples/lms/lms_mean_values/src/Makefile
config.status: creating c++/examples/lms/lms_partial_scan/Makefile
config.status: creating c++/examples/lms/lms_partial_scan/src/Makefile
config.status: creating c++/examples/lms/lms_plot_values/Makefile
config.status: creating c++/examples/lms/lms_plot_values/src/Makefile
config.status: creating c++/examples/lms/lms_real_time_indices/Makefile
config.status: creating c++/examples/lms/lms_real_time_indices/src/Makefile
config.status: creating c++/examples/lms/lms_set_variant/Makefile
config.status: creating c++/examples/lms/lms_set_variant/src/Makefile
config.status: creating c++/examples/lms/lms_simple_app/Makefile
config.status: creating c++/examples/lms/lms_simple_app/src/Makefile
config.status: creating c++/examples/lms/lms_stream_range_and_reflect/Makefile
config.status: creating c++/examples/lms/lms_stream_range_and_reflect/src/Makefile
config.status: creating c++/examples/lms/lms_subrange/Makefile
config.status: creating c++/examples/lms/lms_subrange/src/Makefile
config.status: creating c++/drivers/Makefile
config.status: creating c++/drivers/ld/Makefile
config.status: creating c++/drivers/ld/sickld-1.0/Makefile
config.status: creating c++/drivers/lms/Makefile
config.status: creating c++/drivers/lms/sicklms-1.0/Makefile
config.status: creating c++/drivers/base/src/SickConfig.hh
config.status: executing depfiles commands

在运行$make之后,我得到了这个错误:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
me@ MyPC:~/smetiste/Sick/sicktoolbox-1.0.1$ make
Making all in c++
make[1]: Entering directory `/home/me/smetiste/Sick/sicktoolbox-1.0.1/c++'
Making all in drivers
make[2]: Entering directory `/home/me/smetiste/Sick/sicktoolbox-1.0.1/c++/drivers'
Making all in ld
make[3]: Entering directory `/home/me/smetiste/Sick/sicktoolbox-1.0.1/c++/drivers/ld'
Making all in sickld-1.0
make[4]: Entering directory `/home/me/smetiste/Sick/sicktoolbox-1.0.1/c++/drivers/ld/sickld-1.0'
/bin/sh ../../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../../c++/drivers/base/src  -I../../../../c++/drivers/base/src   -g -O2 -MT SickLD.lo -MD -MP -MF .deps/SickLD.Tpo -c -o SickLD.lo SickLD.cc
mkdir .libs
 g++ -DHAVE_CONFIG_H -I. -I../../../../c++/drivers/base/src -I../../../../c++/drivers/base/src -g -O2 -MT SickLD.lo -MD -MP -MF .deps/SickLD.Tpo -c SickLD.cc  -fPIC -DPIC -o .libs/SickLD.o
SickLD.cc: In member function 'void SickToolbox::SickLD::_flushTCPRecvBuffer()':
SickLD.cc:4137:35: warning: ignoring return value of 'ssize_t read(int, void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
        read(_sick_fd,&null_byte,1);
                                   ^
 g++ -DHAVE_CONFIG_H -I. -I../../../../c++/drivers/base/src -I../../../../c++/drivers/base/src -g -O2 -MT SickLD.lo -MD -MP -MF .deps/SickLD.Tpo -c SickLD.cc -o SickLD.o >/dev/null 2>&1
mv -f .deps/SickLD.Tpo .deps/SickLD.Plo
/bin/sh ../../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../../c++/drivers/base/src  -I../../../../c++/drivers/base/src   -g -O2 -MT SickLDMessage.lo -MD -MP -MF .deps/SickLDMessage.Tpo -c -o SickLDMessage.lo SickLDMessage.cc
 g++ -DHAVE_CONFIG_H -I. -I../../../../c++/drivers/base/src -I../../../../c++/drivers/base/src -g -O2 -MT SickLDMessage.lo -MD -MP -MF .deps/SickLDMessage.Tpo -c SickLDMessage.cc  -fPIC -DPIC -o .libs/SickLDMessage.o
 g++ -DHAVE_CONFIG_H -I. -I../../../../c++/drivers/base/src -I../../../../c++/drivers/base/src -g -O2 -MT SickLDMessage.lo -MD -MP -MF .deps/SickLDMessage.Tpo -c SickLDMessage.cc -o SickLDMessage.o >/dev/null 2>&1
mv -f .deps/SickLDMessage.Tpo .deps/SickLDMessage.Plo
/bin/sh ../../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../../c++/drivers/base/src  -I../../../../c++/drivers/base/src   -g -O2 -MT SickLDBufferMonitor.lo -MD -MP -MF .deps/SickLDBufferMonitor.Tpo -c -o SickLDBufferMonitor.lo SickLDBufferMonitor.cc
 g++ -DHAVE_CONFIG_H -I. -I../../../../c++/drivers/base/src -I../../../../c++/drivers/base/src -g -O2 -MT SickLDBufferMonitor.lo -MD -MP -MF .deps/SickLDBufferMonitor.Tpo -c SickLDBufferMonitor.cc  -fPIC -DPIC -o .libs/SickLDBufferMonitor.o
In file included from SickLDBufferMonitor.hh:24:0,
                 from SickLDBufferMonitor.cc:24:
../../../../c++/drivers/base/src/SickBufferMonitor.hh: In member function 'void SickToolbox::SickBufferMonitor<SICK_MONITOR_CLASS, SICK_MSG_CLASS>::_readBytes(uint8_t*, int, unsigned int) const':
../../../../c++/drivers/base/src/SickBufferMonitor.hh:356:47: error: there are no arguments to 'getdtablesize' that depend on a template parameter, so a declaration of 'getdtablesize' must be available [-fpermissive]
       num_active_files = select(getdtablesize(),&file_desc_set,0,0,(timeout_value > 0) ? &timeout_val : 0);
                                               ^
../../../../c++/drivers/base/src/SickBufferMonitor.hh:356:47: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../../../../c++/drivers/base/src/SickBufferMonitor.hh:370:73: error: there are no arguments to 'read' that depend on a template parameter, so a declaration of 'read' must be available [-fpermissive]
      num_bytes_read = read(_sick_fd,&dest_buffer[total_num_bytes_read],1);
                                                                         ^
../../../../c++/drivers/base/src/SickBufferMonitor.hh: In static member function 'static void* SickToolbox::SickBufferMonitor<SICK_MONITOR_CLASS, SICK_MSG_CLASS>::_bufferMonitorThread(void*)':
../../../../c++/drivers/base/src/SickBufferMonitor.hh:456:18: error: there are no arguments to 'usleep' that depend on a template parameter, so a declaration of 'usleep' must be available [-fpermissive]
       usleep(1000);
                  ^
../../../../c++/drivers/base/src/SickBufferMonitor.hh: In instantiation of 'void SickToolbox::SickBufferMonitor<SICK_MONITOR_CLASS, SICK_MSG_CLASS>::_readBytes(uint8_t*, int, unsigned int) const [with SICK_MONITOR_CLASS = SickToolbox::SickLDBufferMonitor; SICK_MSG_CLASS = SickToolbox::SickLDMessage; uint8_t = unsigned char]':
SickLDBufferMonitor.cc:59:2:   required from here
../../../../c++/drivers/base/src/SickBufferMonitor.hh:356:47: error: 'getdtablesize' was not declared in this scope
       num_active_files = select(getdtablesize(),&file_desc_set,0,0,(timeout_value > 0) ? &timeout_val : 0);
                                               ^
../../../../c++/drivers/base/src/SickBufferMonitor.hh:370:73: error: 'read' was not declared in this scope
      num_bytes_read = read(_sick_fd,&dest_buffer[total_num_bytes_read],1);
                                                                         ^
make[4]: *** [SickLDBufferMonitor.lo] Error 1
make[4]: Leaving directory `/home/me/smetiste/Sick/sicktoolbox-1.0.1/c++/drivers/ld/sickld-1.0'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/me/smetiste/Sick/sicktoolbox-1.0.1/c++/drivers/ld'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/me/smetiste/Sick/sicktoolbox-1.0.1/c++/drivers'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/me/smetiste/Sick/sicktoolbox-1.0.1/c++'
make: *** [all-recursive] Error 1
me@ MyPC:~/smetiste/Sick/sicktoolbox-1.0.1$ 

我听说在新版本中使用“旧”包可能很棘手。但有没有可能让它发挥作用呢?

在Linux上,有没有其他方法可以从这个扫描仪中获取数据,因为它没有任何内部存储器?

EN

回答 2

Stack Overflow用户

发布于 2016-03-06 22:02:07

该协议相对简单和well documented。不要被文档的大小吓倒,为了实际使用,您需要一个非常小的子集(命令10h,20h和响应90h,91h,92h,B0h开始)。

下面是一个小Python脚本,可以帮助您入门:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import binascii
import serial
import threading

# =============================================================================

SERIAL_PORT = 'COM6'
# NB: Different crystal, x8 multiplier
SERIAL_BAUDRATE = int(500000 * 14745600 / 16000000 / 8)
SERIAL_TIMEOUT = 1

# =============================================================================

def lms200_crc(data):
  crc16 = 0
  byte = [0,0]
  for c in data:
    byte[1] = byte[0]
    byte[0] = ord(c)

    if (crc16 & 0x8000):
      crc16 = (crc16 & 0x7FFF) << 1
      crc16 ^= 0x8005
    else:
      crc16 = crc16<< 1

    crc16 ^= (byte[1] << 8) | byte[0]

  return crc16

# =============================================================================

class LMS200Telegram(object):
  def __init__(self, data=None):
    if data:
      if len(data) < 7:
        raise RuntimeError("Invalid telegram size")
      if data[0] != '\x02':
        raise RuntimeError("Invalid STX")
      self.address = ord(data[1])
      self.length = ord(data[2]) + (ord(data[3]) * 256)
      self.payload = data[4:-2]
      self.crc = ord(data[-2]) + (ord(data[-1]) * 256)
    else:
      self.address = 0
      self.length = 0
      self.payload = ''
      self.crc = 0

  def generate(self):
    data = '\x02' + chr(self.address)
    self.length = len(self.payload)
    data += chr(self.length & 0xFF)
    data += chr((self.length >> 8) & 0xFF)
    data += self.payload
    self.crc = lms200_crc(data)
    data += chr(self.crc & 0xFF)
    data += chr((self.crc >> 8) & 0xFF)
    return data

class LMS200Command(object):
  def __init__(self, payload):
    if len(payload) < 1:
      raise RuntimeError("Invalid payload size")
    self.opcode = ord(payload[0])
    self.body = payload[1:]

class LMS200Response(object):
  def __init__(self, payload):
    if len(payload) < 2:
      raise RuntimeError("Invalid payload size")
    self.opcode = ord(payload[0])
    self.status = ord(payload[-1])
    self.body = payload[1:-1]

# =============================================================================

def cmd_reset_sensor():
  t = LMS200Telegram()
  t.payload = '\x10'
  return t

def cmd_start_measurement():
  t = LMS200Telegram()
  t.payload = '\x20\x20'
  return t

# =============================================================================

class LMS200Interface(object):
  def __init__(self, port, baudrate, timeout):
    self.port = port
    self.baudrate = baudrate
    self.timeout = timeout
    self.serial = None
    self.serial_rlock = threading.Lock()
    self.serial_wlock = threading.Lock()
    self.buffer = []

  def open_port(self):
    self.serial = serial.Serial(port=self.port
      , baudrate=self.baudrate
      , timeout=self.timeout)

  def close_port(self):
    self.serial.close()
    self.serial = None

  def process_data(self, data):
    self.buffer += data

  def write_telegram(self, t):
    self.serial.flush()
    with self.serial_wlock:
      self.serial.write(t.generate())
    with self.serial_rlock:
      while True:
        ack = self.serial.read(1)
        if len(ack) > 0:
          if ack == '\x06':
            return True
          elif ack == '\x15':
            return False
          else:
            raise RuntimeError("Invalid value received (neither ACK, nor NACK)")

  def worker(self):
    if not self.serial:
      raise RuntimeError("Serial port not initialized.")

    print "Reading serial port '%s'..." % self.port

    while(not self.stop_flag):
      data = self.serial.read(1024)
      if len(data) > 0:
        print "Got %d bytes." % len(data)
        self.process_data(data)

  def run(self):
    lms.open_port()
    self.thread = threading.Thread(target=self.worker)
    self.stop_flag = False
    self.thread.start()

  def stop(self):
    self.stop_flag = True
    self.thread.join()
    lms.close_port()

# =============================================================================

lms = LMS200Interface(SERIAL_PORT, SERIAL_BAUDRATE, SERIAL_TIMEOUT)

lms.run()

您仍然需要将process_data方法扩展为:

  • 检测并分离各个电报帧。
    • 最简单的方法是找到STX字节的匹配项。地址字节通常是常量,所以你实际上可以搜索例如0x02 0x80。您还可以对长度进行一些验证。然后尝试读取有效负载,并查看CRCs match.

  • 当您识别电报时,您需要解析有效载荷。使用Python module.

byte.

  • Interpret
  • 通过有效负载的命令/响应识别有效负载类型

  • 可根据您的需要处理测量数据。确切的形式将取决于测量模式。例如,在基本测量模式中,您将有一个以毫米为单位的361个16位距离数组,以0.5度步长为单位。您需要屏蔽存储在最高有效位中的标志,并处理代表错误条件的特殊值。

我没有在脚本中实现这一点,因为它只在我们的串行卡出现兼容性问题时执行一些基本的通信测试。

票数 1
EN

Stack Overflow用户

发布于 2016-07-05 22:11:38

在SickBufferMonitor.hh & SickLIDAR.hh中包含unistd.h头文件解决了这个问题,并成功地结束了这个问题

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32915251

复制
相关文章
Python Numpy 从文件中读取数据
测试文件内容(test1.txt) hello,123,nihao 8,9,10 io,he,no 测试代码 import numpy # dtype:默认读取数据类型,delimiter:分隔符 world_alcohol = numpy.genfromtxt("test1.txt", dtype=str, delimiter=",") # 数据结构 print(type(world_alcohol)) # 数据内容 print(world_alcohol) # 帮助文档 print(help(nump
山海散人
2021/03/03
4.2K0
matlab读取mnist数据集(c语言从文件中读取数据)
mnist database(手写字符识别) 的数据集下载地:http://yann.lecun.com/exdb/mnist/。
全栈程序员站长
2022/08/01
5K0
matlab读取mnist数据集(c语言从文件中读取数据)
Java串口编程:串口数据的发送与监听读取「建议收藏」
本人在近期的开发工作中遇到向串口发送设备控制指令的需求,遂对串口编程进行了略微深入的钻研,在此对自己的一些心得和经验进行总结,以供大家参考与交流。 #串口介绍 #   串口全称为串行接口,一般指COM接口,是采用串行通信方式的扩展接口。其特点是数据位的传送按位顺序进行,最少只需一根传输线即可完成,成本低但传送速度慢。由于串口(COM)不支持热插拔及传输速率较低,目前部分新主板和大部分便携电脑已取消该接口。现在串口多用于工业控制和测量设备以及部分通信设备中。   根据美国电子工业协会(EIA: Electronic Industry Association)制定的标准,串口可以分为RS-232、RS-422以及RS-485等种类,其中以RS-232类型的接口最为典型和常见,本文所使用的是RS-232类型的9针串口(RS-232类型有25接口,但是现在几乎不再使用)。如图 1所示,是RS-232类型9针串口的实物示意图。RS-232类型9针串口每一个引脚的作用说明如图 2所示。
全栈程序员站长
2022/11/17
6.5K0
Java串口编程:串口数据的发送与监听读取「建议收藏」
用Pandas从HTML网页中读取数据
本文,我们将通过几步演示如何用Pandas的read_html函数从HTML页面中抓取数据。首先,一个简单的示例,我们将用Pandas从字符串中读入HTML;然后,我们将用一些示例,说明如何从Wikipedia的页面中读取数据。
老齐
2020/05/15
9.6K0
用Pandas从HTML网页中读取数据
VFP多线程读取串口
因为我要发送的指令很多,所以当时用方案二同步去读取,结果很卡。方法一倒没有试过,但COM口只支持16个。
加菲猫的VFP
2023/08/21
3280
VFP多线程读取串口
如何从 Ring Buffer 读取?
原文地址:http://mechanitis.blogspot.com/2011/06/dissecting-disruptor-how-do-i-read-from.html​​ 作者是 Trisha Gee, LMAX 公司的一位女工程师。 这是理解 LMAX​ 开发的 Disruptor 模式​ 系列博客的下一篇。 从 上一篇博客​ 我们都明白了什么是 Ring Buffer 以及 它有多棒。遗憾的是,我还没有提到当你实际使用 Disruptor 时,怎样读写数据。 ConsumerBarrier 与
张善友
2018/01/29
2K0
如何从 Ring Buffer 读取?
CAT客户端如何从Apollo中读取配置?
以下就是这个示例的运行环境,如果版本号不一样,区别也应该不会很大,可以根据实际情况做相应调整。
万猫学社
2022/04/22
3.7K0
CAT客户端如何从Apollo中读取配置?
【说站】Python中JSON数据如何读取
2、由直接从JSON文件读写的JSON函数组成。Python内置JSON包,是标准库的一部分,不需要安装。
很酷的站长
2022/11/24
2.1K0
【说站】Python中JSON数据如何读取
如何用R语言从网上读取多样格式数据
生活中,我们面临着各种各样的数据:比如你的成绩单,比如公司的财务报表,比如朋友圈的一些状态,比如微信里的一段语音……我们生活的大数据时代的一个重要特征便是数据的多样化(variety)。
机器学习AI算法工程
2018/03/14
7K0
如何用R语言从网上读取多样格式数据
如何同时从多个文本文件读取数据
在很多时候,需要对多个文件进行同样的或者相似的处理。例如,你可能会从多个文件中选择数据子集,根据多个文件计算像总计和平均值这样的统计量。当文件数量增加时,手动处理文件的可能性会减小,出错的概率会增加。
TalkPython
2019/05/24
3.9K0
如何用R语言从网上读取多样格式数据
生活中,我们面临着各种各样的数据:比如你的成绩单,比如公司的财务报表,比如朋友圈的一些状态,比如微信里的一段语音……我们生活的大数据时代的一个重要特征便是数据的多样化(variety)。 也许你期待的数据是这样的:
机器学习AI算法工程
2018/03/12
6.2K0
如何用R语言从网上读取多样格式数据
从天擎读取EC数据
最近我们在试用天擎,测试了从天擎读取EC数据,请求数据的程序来自天擎网站(见下图),数据传输的速度和稳定度都相当不错,尤其是可以按需求请求数据,避免了“一个馒头搭块糕”式的打包式下载数据对于时间和存储空间的极大浪费。请求江苏地区要素场时,数据基本秒出,感觉畅爽无比
郭好奇同学
2021/03/25
2K0
从天擎读取EC数据
如何使用python读取txt文件中的数据
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/139037.html原文链接:https://javaforall.cn
全栈程序员站长
2022/09/02
6.8K0
python从txt文件读取数据
  (作为一个python初学者,记录一点学习期间的笔记,方便日后查阅,若有错误或者更加便捷的方法,望指出!)
py3study
2020/01/19
3.9K0
python从txt文件读取数据
java pfx,如何从Java中的PFX文件读取公钥[通俗易懂]
I am able to read private key from PFX file but not public key. I am using following code to read public key.
全栈程序员站长
2022/08/14
4.7K0
如何从Node.js中的命令行读取输入
您是否正在使用Node.js中开发一个小的CLI工具,并希望能够提示用户从命令行输入输入? Node.js正是为此目的提供了readline模块。 它提供了一个接口,用于从可读流(例如process.stdin)中一次读取一行数据。
ccf19881030
2020/10/26
8.6K0
病态方程组
其精确解是x=1.0,y=0.0 。如图所示,点(1.0,0.0)是方程组所表示的两条直线的交点。
fem178
2019/07/17
1.1K0
病态方程组
实用:如何将aop中的pointcut值从配置文件中读取
改造老项目,须要加一个aop来拦截所的web Controller请求做一些处理,由于老项目比较多,且包的命名也不统一,又不想每个项目都copy一份相同的代码,这样会导致后以后升级很麻烦,不利于维护。于是我们想做成一个统一的jar包来给各项目引用,这样每个项目只须要引用该jar,然后配置对应的切面值就可以了。
Bug开发工程师
2019/12/09
24K1
如何读取单细胞数据
注:同方法二,如果没有 “all.datatable.txt” 的文件,也可忽略此步骤。这里只是提供多种情况下的读入方法。(想尝试的话,方法一有生成 “all.datatable.txt” 的代码,不过要注意路径。)
生信技能树jimmy
2020/06/23
5.4K0
点击加载更多

相似问题

从串口读取数据

50

从串口读取数据

10

从串口读取数据

31

如何从串口读取数据和向串口写入数据?

22

如何从串口读取GPS数据

122
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文