It is assumed that your Jetson device does not have arm-linux-gnueabihf-gcc installed. Therefore, you need to install it by running the command below. sudo apt-get install gcc-arm-linux-gnueabihf I hope that this helps you.
Hi, This is my answer to your two question. (1) IPDiscovery protocol is not opened now. So, you can't read the lidar IP address. And there is no way to read it without IPDiscovery. (2) IPDiscovery can reset the lidar IP setting. But IPDiscovery protocol is not opened now. So, you can't reset the lidar IP setting from code.
Hi. I noticed my mistake by your pointing out. Thank you. I modified my past reply message. The rebootMsg must be "RB\x0aRB\x0a". So your code is correct.
You have to reboot sensor to apply new IP Address. So, you have to send reboot command ("RB\nRB\n") after sending "$IP" command. (or power off and power on.) this is modified python code. (on python2) msg = "$IP" + ip + nm + gw + "\x0a" #rebootMsg = "$RB\x0a$RB\x0a" rebootMsg = "RB\x0aRB\x0a" sock = socket.socket() sock.connect((args.ip, 10940)) print("Updating settings") sock.send(msg) sock.send(rebootMsg) (on python3) msg = "$IP" + ip + nm + gw + "\x0a" #rebootMsg = "$RB\x0a$RB\x0a" rebootMsg =...
Hi. You cannot get the contamination status through Ethernet directly. But you can get the IO status by using "GF", "GG", "MF", "MG" commands. The 13th bit of IO status is Ready output. If sensor detect contamination or failure condition, the Ready output will be 0.
MDコマンドの応答は2段階で返ってきます。 まず最初にステータスが00の応答が返ってきます。これはMDコマンドを正常に受け取ったという意味の応答です。 そして次にステータスが99の応答の応答が返ってきて、これにはタイムスタンプと距離データが一緒についてきます。 それ以後ステータス99の応答が連続して返ってきます。 提示されたコードでは何回もMDコマンドを送信しているようですが、こういった仕様のコマンドですので、MDコマンドを送信するのは1回でよく、あとは受信するだけでいいです。 decode関数に関してはこれでいいですが、呼び出し部分は違います。 この呼び出し方だと"c"という文字列を4バイト分デコードすることになっています。これでは受信データのデコードはしていませんし、バッファオーバーフローもしてしまってます。 もう少し考えてみてください。
センサのIPアドレスが192.168.0.11なのであれば、ArduinoのIPアドレスも同一ネットワークの192.168.0.* (192.168.0.100とか)にする必要があります。 同一ネットワークかどうかを決める値にサブネットマスクというものがありますが、このサンプルコードではサブネットマスクは指定せず、デフォルト値を使っています。ArduinoのEthernetライブラリのサブネットマスクのデフォルト値は255.255.255.0となっています。 http://www.musashinodenpa.com/arduino/ref/index.php?f=1&pos=1167 サブネットマスクとネットワークの関係は https://www.cman.jp/network/term/subnet/ とかで勉強してください。
センサのIPアドレスが192.168.0.11なのであれば、ArduinoのIPアドレスも同一ネットワークの192.168.0.* (192.168.0.100とか)にする必要があります。 同一ネットワークかどうかを決める値にサブネットマスクというものがありますが、このサンプルコードではサブネットマスクは指定せず、デフォルト値を使っています。ArduinoのEthernetライブラリのサブネットマスクのデフォルト値は255.255.255.0となっています。 http://www.musashinodenpa.com/arduino/ref/index.php?f=1&pos=1167 サブネットとネットワークの関係は https://www.cman.jp/network/term/subnet/ とかで勉強してください。