[Discourse.ros.org] [Client Libraries/rosjava] Sending a Byte Array Message

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Client Libraries/rosjava] Sending a Byte Array Message

Dirk Thomas via ros-users


Hi

I'm looking to send a byte multi array message from rosjava.

I'm using this structure but the apps in Android stop automatically when execute nuevo.setdata(eee).

  std_msgs.ByteMultiArray nuevo = pubremotecontrol.newMessage();
                                                       ChannelBuffer eee= ChannelBuffers.dynamicBuffer();
                                                       eee.writeInt(4);
                                                       eee.writeBytes(new byte[] {0x22,0x32,0x22,0x11});

                                                               //copiedBuffer(new byte[] {0x22,0x32,0x22,0x11});
                                                       nuevo.setData(eee);
                                                       pubremotecontrol.publish(nuevo);





---
[Visit Topic](https://discourse.ros.org/t/sending-a-byte-array-message/2534/1) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Client Libraries/rosjava] Sending a Byte Array Message

Dirk Thomas via ros-users


Hi Gabriel,
Can you paste the error message from logcat?
Also you can check [this example](https://github.com/rosjava/rosjava_bootstrap/blob/kinetic/message_generation/src/test/java/org/ros/internal/message/RawMessageSerializationTest.java#L244-L252) to compare.





---
[Visit Topic](https://discourse.ros.org/t/sending-a-byte-array-message/2534/2) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Client Libraries/rosjava] Sending a Byte Array Message

Dirk Thomas via ros-users
In reply to this post by Dirk Thomas via ros-users


08-30 16:28:00.651 16610-16610/? E/Zygote: MountEmulatedStorage()
08-30 16:28:00.651 16610-16610/? E/Zygote: v2
08-30 16:28:00.656 16610-16610/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
08-30 16:28:04.626 16610-16697/com.baro.barosystem.barocar E/Resources: RunTimeException
                                                                        android.content.res.Resources$NotFoundException: Resource ID #0x7f02005a
                                                                            at android.content.res.Resources.getValue(Resources.java:2345)
                                                                            at android.content.res.Resources.startRC(Resources.java:1059)
                                                                            at android.app.ActivityThread$mRunnable.run(ActivityThread.java:2517)
                                                                            at java.lang.Thread.run(Thread.java:818)
08-30 16:28:08.256 16610-16819/com.baro.barosystem.barocar E/AndroidRuntime: FATAL EXCEPTION: pool-2-thread-18
                                                                             Process: com.baro.barosystem.barocar, PID: 16610
                                                                             java.lang.IllegalArgumentException
                                                                                 at com.google.common.base.Preconditions.checkArgument(Preconditions.java:76)
                                                                                 at org.ros.internal.message.field.ChannelBufferField.setValue(ChannelBufferField.java:55)
                                                                                 at org.ros.internal.message.MessageProxyInvocationHandler.invoke(MessageProxyInvocationHandler.java:46)
                                                                                 at java.lang.reflect.Proxy.invoke(Proxy.java:397)
                                                                                 at org.ros.internal.message.$Proxy2.setData(Unknown Source)
                                                                                 at com.baro.barosystem.barocar.RosAlive$1.loop(RosAlive.java:109)
                                                                                 at org.ros.concurrent.CancellableLoop.run(CancellableLoop.java:56)
                                                                                 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                                 at java.lang.Thread.run(Thread.java:818)





---
[Visit Topic](https://discourse.ros.org/t/sending-a-byte-array-message/2534/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>