Possible that some CANbus message are eaten?

S

Stéphane de Luca

I am developing a firmware update via CANbus 2.0B. The client is written in python to send the firmware binary file to the receiver (an esp32-based custom pcb equipped with a CANbus transceiver). The communication runs at 500kbps.

Simply put, the protocole I ended up with is as follows: the client opens the firmware file, read 8-byte chunk and transmits the chunk of the file, to the receiver, which keeps track of the chunk index, starting from 0 and incrementing. On the receiver, on chunk reception, the chunk is written to the flash via a RAM buffer. The receiver keeping track of the index on its side as well, it sends a message back (with a different arbitration id) that contains the index in the payload. So that the client can compare the receiver index with its own and potentially emit a transmission error if they mismatch. The file to transfer is about 1.4MB. The whole process takes about 8 minutes.

My messages use normal communication (aka not a listener nor a no-ack). It does not use CANbus filtering either.

That kind of handshake works nicely when the mac that bears an USB peak adapter which itsel is connected via two wires to the esp32 pcb can high/low connector.

Now, the receiver is actually a battery and the esp32 pcb set in its enclosure.

The battery is itself inserted in a transport robot. The battery communication port is connected to the comm port of the robot. That very CANbus port is located inside the chassis of the robot. But the robot has another CANbus port outside the chassis that is easily accessible.

So when I plug my peak to the « outside » port, and keep the robot turned off, the firmware update works nicely the same way it works in direct connection (aka straight to the battery), whilst I noticed a longer time to transfer (12 minutes).

Now, when the robot is turned on, the process stops working. It is kind of my messages are lost somewhere.

The CANbus communication itself seems to work: my client sees others standard messages coming from one of the robot devices. The robot itself has 3 devices connected to the CANbus. Those devices use 500kbps as well. From the 3 devices two use standard frames while the third uses extended frames.

The robot manufacturer says the bus is low loaded (around 5% of the maximum).

What would potentially be the source of the problem? What could I setup to better investigate the situation?
 

Unreplied Threads

Is there a software implementing Mozarts dice game?

  • Jens Piegsa
  • Technology
  • Replies: 0
A [..] "musical dice game" was a system for using dice to randomly 'generate' music from precomposed options. These 'games' were quite popular throughout Western Europe in the 18th century. Several different games were devised, some that did not require dice, but merely 'choosing a random number.'

This web page demonstrates the concept. I'm looking for a software that implements that. Even more great would be an advanced version

  • with support for jazz voicings using common chord progression
  • the option to specify the basic song part structure
  • a feature for "re-dicing" sub-parts
  • playback / export to midi
  • export of chord progression to plain-text.

UnityでPUN2を使用したMetaQuest3のMRマルチプレイでHeadとHandの位置がずれる問題について

私は現在、Unityを使用してMeta Quest 3向けのローカル空間で動作するMRマルチプレイヤーアプリケーションを開発しています。このアプリケーションではPUN2を通信手段として使用しており、プレイヤーのHeadとLeft Hand、Right Handを同期させたいと考えています。

問題点 アプリケーション内で、2つのHMD(Meta Quest 3)を使用してプレイした際、HeadとHandの位置が実際のユーザーの体の位置と大きくずれてしまいます。具体的には、HeadとHandのオブジェクトが、相手プレイヤーの体の位置に適切に重ならず、誤った位置に表示されてしまいます。

実現したいこと HeadとHandが、相手ユーザーの体の実際の位置に正確に重なるようにしたいです。現状では、ずれて表示されてしまっているため、これを解決する方法をご提案いただきたいです。

現在の設定

  • OVRCameraRigを使用してカメラを配置しています。
  • OVRSceneManagerおよびPassthrough機能を使用しています。

現在使用しているスクリプト
NetworkManager.cs

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;

public class NetworkManager : MonoBehaviourPunCallbacks
{
    void Start()
    {
        ConnectToServer();
    }

    void ConnectToServer()
    {
        PhotonNetwork.ConnectUsingSettings();
        Debug.Log("Connecting to server...");
    }

    public override void OnConnectedToMaster()
    {
        Debug.Log("Connected to server.");
        base.OnConnectedToMaster();
        RoomOptions roomOptions = new RoomOptions();
        roomOptions.MaxPlayers = 4;
        roomOptions.IsVisible = true;
        roomOptions.IsOpen = true;

        PhotonNetwork.JoinOrCreateRoom("Room 1", roomOptions, TypedLobby.Default);
    }

    public override void OnJoinedRoom()
    {
        Debug.Log("Joined room.");
        base.OnJoinedRoom();
    }

    public override void OnPlayerEnteredRoom(Player newPlayer)
    {
        Debug.Log("New player joined.");
        base.OnPlayerEnteredRoom(newPlayer);
    }
}

NetworkPlayerSpawner.cs

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;

public class NetworkPlayerSpawner : MonoBehaviourPunCallbacks
{
    public GameObject spawnedPlayerPrefab;
    public override void OnJoinedRoom()
    {
        base.OnJoinedRoom();
        spawnedPlayerPrefab = PhotonNetwork.Instantiate("Network Player", transform.position, transform.rotation);
    }

    public override void OnLeftRoom()
    {
        base.OnLeftRoom();
        PhotonNetwork.Destroy(spawnedPlayerPrefab);
    }
}

NetworkPlayer.cs

Code:
using UnityEngine;
using Photon.Pun;

public class NetworkPlayer : MonoBehaviour
{
    public Transform head;
    public Transform leftHand;
    public Transform rightHand;
    private PhotonView photonView;

    public Animator leftHandAnimator;
    public Animator rightHandAnimator;

    private Transform headRig;
    private Transform leftHandRig;
    private Transform rightHandRig;

    void Start()
    {
        photonView = GetComponent<PhotonView>();
        OVRCameraRig rig = FindObjectOfType<OVRCameraRig>();
        headRig = rig.centerEyeAnchor;
        leftHandRig = rig.leftHandAnchor;
        rightHandRig = rig.rightHandAnchor;

        if (photonView.IsMine)
        {
            foreach (var item in GetComponentsInChildren<Renderer>())
            {
                item.enabled = false;
            }
        }
    }

    void Update()
    {
        if (photonView.IsMine)
        {
            MapPosition(head, headRig);
            MapPosition(leftHand, leftHandRig);
            MapPosition(rightHand, rightHandRig);

            UpdateHandAnimation(OVRInput.Controller.LTouch, leftHandAnimator);
            UpdateHandAnimation(OVRInput.Controller.RTouch, rightHandAnimator);
        }
    }

    void UpdateHandAnimation(OVRInput.Controller controller, Animator handAnimator)
    {
        float triggerValue = OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger, controller);
        handAnimator.SetFloat("Trigger", triggerValue);

        float gripValue = OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger, controller);
        handAnimator.SetFloat("Grip", gripValue);
    }

    void MapPosition(Transform target, Transform rigTransform)
    {
        target.position = rigTransform.position;
        target.rotation = rigTransform.rotation;
    }
}

試したこと 現在のところ、PUN2によるオブジェクトの同期は問題なく行われているようですが、HeadやHandの位置が適切にプレイヤーの体に重ならず、大きくずれてしまう状況です。具体的な原因や解決策がわからないため、アドバイスをいただけると助かります。

何か、HeadとHandの位置を正確にプレイヤーに重ねるためのアプローチがあれば、ぜひご教示ください。

よろしくお願いいたします。

sorted() возвращает TypeError:'<' not supported between instances of 'NoneType' and 'float'

Есть словарь

array = {'string1':12.3, 'string2':0.4,......}

Требуется отсортировать по значениям. Значения float. Что я делаю:

Code:
sorted_array = sorted(array.items(), key = lambda x:float(x[1]))

Ловлю ошибку:

TypeError: float() argument must be a string or a real number, not 'NoneType'

Гугление пока что не помогло..

Как вызвать конвейерную функцию? ORA-06553: PLS-306: ошибочно число или типы аргументов при обращении к 'GET_ZP' [дубликат]

Code:
is
type kol_dep is record (sum_sal          number,
                        min_sal          number,
                        max_sal          number,
                        names varchar2(1000),
                        dep_id          number);
    type kol_dep_tb is table of kol_dep;
    
    v_kol_dep_tb kol_dep_tb;
    function get_zp (proc_tbl kol_dep_tb) return kol_dep_tb pipelined;
    end pkg_agg_employees;
    
    ---------TELO PAKETA-------
    
    create or replace package body pkg_agg_employees
    is

function get_zp (proc_tbl kol_dep_tb) return kol_dep_tb pipelined
     is
     v_report_row kol_dep;
     
     cursor c_dep
     is
     select e.department_id as dep,
    sum(e.salary)sum_sal,
    min(e.salary)min_sal,
    max(e.salary)max_sal,
    listagg(e.first_name||' '||e.last_name|| ', '||chr(10))within group (order by e.last_name) as names
    from employees e
    inner join departments dep
    on e.department_id=dep.department_id
    inner join jobs j
    on e.job_id=j.job_id
    group by e.department_id
    order by e.department_id;
         begin
         for r in c_dep loop
        v_report_row:=null;
v_report_row.dep_id:=r.dep;
v_report_row.sum_sal:=r.sum_sal;
v_report_row.min_sal:=r.min_sal;
v_report_row.max_sal:=r.max_sal;
v_report_row.names:=r.names;
         pipe row (v_report_row);
         end loop;
         return;
         close c_dep;
end get_zp;
end pkg_agg_employees;```






не понимаю куда вставить 




 ```DECLARE
v_table pkg_agg_employees.kol_dep_tb;

BEGIN
  v_table := pkg_agg_employees.kol_dep_tb();
  SELECT *
  FROM TABLE(pkg_agg_employees.get_zp(v_table));
END; ```
или как по-другому исправить эту ошибку?

Помогите сделать такую таблицу html

[!
HTML:
[1]][1]

[1]: [URL]https://i.sstatic.net/82Xar8QT.jpg[/URL] помогите сделать такую таблицу html

How to stop org-latex-preview from turning the whole buffer or file to an image instead of the equation where the cursor is?

  • userrandrand
  • Technology
  • Replies: 0
I stopped using emacs for a while, then upgraded to the latest emacs and I am having trouble with org-latex-preview. I am not sure what I used to use to preview images but that function turns the whole document to an image rather than the equation the cursor is on.

I can turn all of the equations into images without turning the whole document to an image in Latex mode.

What is the best way to protect from polymorphic viruses?

  • security_paranoid
  • Technology
  • Replies: 0
Due to malware infections becoming more and more common, antivirus are a growing industry.

But it is common knowledge that polymorphic viruses (that rewrite their own code) are much harder to detect and remove with AVs.

This source, as well as numerous other ones, explains that:

A polymorphic Virus can continue to alter the signature and attack undetected even after a fresh signature is found and added to the antivirus solution's signature database.

So what is the best way to protect against polymorphic virus infections, in general?

Are there specific protocols/ methodsor is it just the same as other viruses?

Login To add answer/comment
Top