This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWR6843ISK-ODS: ROSPKG modification (3d people counting )

Part Number: IWR6843ISK-ODS

hello

I have been working on rospkg for sometimes now,

so I had a guide recently by Thomas Jackson, his assistance has been really helpful and useful,

but I still run into Tlv error, after using and following the guide 

Ti has proven to be the best and that is why this sensor was chosen but still having problem with just launching the 3d people counting rospkg but still have a long way to go,

please anybody who can help with solving this issue above...

Regards 

Abdullahi 

  • What errors are you running into?

  • thanks for the responds Tlv error

  • There is an error in your switch statement. The header value from the sensor does not match any value in the switch statement. You need to change the switch values such that they match the TLV header value coming out of the sensor. Please reference the people counting gui python source code. 

  • okay thanks

    but which switch statement are you talking about please?

  • Okay thanks

    I will see to it

  •  switch(tlvType)
                    {                  
                        case MMWDEMO_OUTPUT_MSG_POINT_CLOUD_3D:
                            if( (tlvLen) % (sizeof(mmwData.tlvHeader)+sizeof(mmwData.PointCloudUnitData))+(sizeof(mmwData.PointCloudData)*num_Points) == 0)
                            {
                                num_Points_lastframe = num_Points;
                                num_Points = ((tlvLen-sizeof(mmwData.PointCloudUnitData))/sizeof(mmwData.PointCloudData));
                                num_Points_inBuf = (currentBufp->size()) / (sizeof(mmwData.PointCloudUnitData));
                                if( num_Points_inBuf >= num_Points){
                                    //ROS_INFO("Points Num : %d", num_Points);
                                    //ROS_INFO("Go to : Point cloud");
                                    //ROS_INFO("Buffer size  = %d", currentBufp->size());
                                    sorterState = READ_POINT_CLOUD_3D;
                                }
                                else{
                                    ROS_ERROR("Point cloud : buffer empty, points number = %d, points number in buffer = %d", num_Points, num_Points_inBuf);
                                    sorterState = SWAP_BUFFERS;
                                }
                            }
                            else{
                                ROS_ERROR("Number of point cloud is not an integer");
                                sorterState = SWAP_BUFFERS;
                            }
                            break;
                        
                        case MMWDEMO_OUTPUT_MSG_TARGET_LIST_3D:
                            if( (tlvLen)  % sizeof(mmwData.TargetListData) == 0)
                            {
                                num_Targets = (tlvLen)/sizeof(mmwData.TargetListData);
                                num_Targets_inBuf = (currentBufp->size()) / sizeof(mmwData.TargetListData);
                                if( num_Targets_inBuf >= num_Targets){
                                    //ROS_INFO("Target Num : %d", num_Targets);
                                    //ROS_INFO("Go to : Target list");
                                    //ROS_INFO("Buffer size = %d", currentBufp->size());
                                    sorterState = READ_TARGET_LIST_3D;
                                }
                                else{
                                    ROS_ERROR("Targte list : buffer empty, targets number = %d, targets number in buffer = %d", num_Targets, num_Targets_inBuf);
                                    sorterState = SWAP_BUFFERS;
                                }
                            }
                            else{
                                ROS_ERROR("Number of targte list is not an integer");
                                sorterState = SWAP_BUFFERS;
                            }
                            break;
                        
                        case MMWDEMO_OUTPUT_MSG_TARGET_INDEX:
                            num_TargetIdx = (tlvLen)/sizeof(mmwData.TargetIndexData);
                            num_TargetIdx_inBuf = (currentBufp->size()) / sizeof(mmwData.TargetIndexData);
                            if( num_TargetIdx == num_Points_lastframe)
                            {
                                if (num_TargetIdx_inBuf >= num_TargetIdx){
                                    //ROS_INFO("Target Idx : %d", num_TargetIdx);
                                    //ROS_INFO("Go to : Target index");
                                    sorterState = READ_TARGET_INDEX;
                                }
                                else{
                                    ROS_ERROR("Target index : buffer empty, index number = %d, index number in buffer = %d", num_TargetIdx, num_TargetIdx_inBuf);
                                    sorterState = SWAP_BUFFERS;
                                }
                            }
                            else{
                                //ROS_ERROR("Number of targte index is not same as that in the previous frame");
                                //ROS_WARN("Current index = %d, points in previous frame = %d", num_TargetIdx, num_Points_lastframe);
                                sorterState = SWAP_BUFFERS;
                            }
                            break;
                        
                        default
                            ROS_ERROR("TLV header error.");
                            sorterState = SWAP_BUFFERS;
                            break;
    after editing the code to the above
    the tlv error disappeared
    but it is still yet to publish the data
  • Publishing was done correctly, 

    Could it be the fact the num point detected is too high,

    But I will check the roscpp publisher to be on a safer side thanks 

  • hello sabeeh,

    thanks for the information you gave, could you please help check the above code

    because I get the TLV error again thanks

    regards thanks

  • Have you matched the switch cases to the tlv header values of the people counting demos? 

  • can you show me how to do that because thats what have been trying to do

  • I have been trying all method and guideline

    thanks

  • The TLV values comes from the people counting demo. Please refer to the people counting demo's user guide: 

    https://dev.ti.com/tirex/explore/node?node=AAMBDqRctFUaJ4xh6n3SbQ__VLyFKFf__LATEST

    The header value of the people counting demo need to match that of the ROS Driver. Therefore, you need to change the values in the switch statement to match. You have not posted the references of the macros so I assume this is your issue. 

    If you are unable to continue with this method, I would not suggest using or editing ROS driver for your purposes. Please use the People Counting Demo GUI provided in the Industrial toolbox on a windows machine. 

  • using the People Counting demo is out of scope of this projects we are required to make use of ROS

  • As mentioned in other threads with the same related question, modifying ROS components is out of the scope of support for this forum. 

    Please refer to the python source for the People Counting Demo GUI as well as the user's guide linked before, it details the exact parsing needed to be implemented into the ROS Driver. 

    We have already provided everything you need to accomplish this task. 

  • Wow!!!!! this has been of great help to me,

    I discovered by looking through the tlvType and it wasn't collecting the ryt data which is supposed to be between 6-8,

    so I did what was done in the python file by checking if the remaining data was greater than Zero, and if it was it should collect the remaining data and store it in newData variable but I discovered that it has more data 

    what do you think I can do about this