Comments (7)
I'm going to reproduce this.
from micro_ros_espidf_component.
I have this working properly:
int main(int argc, const char * const * argv)
{
rcl_allocator_t allocator = rcl_get_default_allocator();
rclc_support_t support;
// Create init_options
RCCHECK(rclc_support_init(&support, argc, argv, &allocator));
// Create node
rcl_node_t node;
RCCHECK(rclc_node_init_default(&node, "node", "", &support));
// Create publishers
rcl_publisher_t publisher;
RCCHECK(rclc_publisher_init_default(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(sensor_msgs, msg, CompressedImage),
"topic"));
static micro_ros_utilities_memory_conf_t conf = {};
conf.max_string_capacity = 50;
conf.max_ros2_type_sequence_capacity = 5;
conf.max_basic_type_sequence_capacity = 5;
micro_ros_utilities_memory_rule_t rules[] = {
{"header.frame_id", 30},
{"format",4},
{"data", 3000}
};
conf.rules = rules;
conf.n_rules = sizeof(rules) / sizeof(rules[0]);
sensor_msgs__msg__CompressedImage msg_static;
micro_ros_utilities_create_message_memory(
ROSIDL_GET_MSG_TYPE_SUPPORT(sensor_msgs, msg, CompressedImage),
&msg_static,
conf
);
uint8_t pic[2617];
memset(pic, 0xAB, sizeof(pic));
msg_static.data.size = sizeof(pic);
msg_static.header.frame_id = micro_ros_string_utilities_set(msg_static.header.frame_id, "myframe");
msg_static.format = micro_ros_string_utilities_set(msg_static.format, "JPEG");
memcpy(msg_static.data.data,pic,sizeof(pic));
RCSOFTCHECK(rcl_publish(&publisher, &msg_static, NULL));
}
Can you verify this code in your platform?
Could you try to set .format
size to 5, as you need the \0
to finalize the string? I'm not sure if this is taken into account in the library.
Some questions:
- Why are you using
%zu
to printpic->len
iflen
is typesize_t
and width and height are alsosize_t
and you are using%d
? - Is correct that a 320x240 image fits in 2617 bytes?
Edit:
I have been checking the utility library, please set .format
size to something that can fit your string and the null character JPGE\0
.
from micro_ros_espidf_component.
Hi
i will try your code.
Maybe, timer_callback is called by a different task with limited stack.
I will check that.
Is correct that a 320x240 image fits in 2617 bytes?
Yes, it a JPEG image.
Yesterday, i checked with smaller payload.
Up to ~800byte, rcl_publish is working.
from micro_ros_espidf_component.
Maybe you can try to increase the XRCE history to 8 in the colcon.meta: this param
from micro_ros_espidf_component.
Ok,
can i have my own colcon.meta, located with the application code? Outsite micro_ros_espidf_component.
from micro_ros_espidf_component.
Now, it is working.
"rmw_embeddedrtps": {
"cmake-args": [
"-DRMW_ERTPS_MAX_OUTPUT_BUFFER_SIZE=20100"
]
},
Question: How can i use my own/custom colcon.meta outside micro_ros_espidf_component?
from micro_ros_espidf_component.
You can use app-colcon.meta
in the project folder:
micro_ros_espidf_component/CMakeLists.txt
Line 11 in 4bd55e9
Take into account that RMW_embeddedrtps is experimental.
from micro_ros_espidf_component.
Related Issues (20)
- Int32_publisher build problems HOT 4
- rcl/rcl.h: No such file or directory HOT 9
- esp-wroom-32 rebooting after flashing the multithread_publisher in it with udp as transport HOT 2
- Not able to build code int32_publisher_custom_transport over UART HOT 1
- ESP32 does not publish any topic over UART HOT 4
- int32_publisher not building for esp32c3 HOT 2
- freertos_int32_publisher stops publishing after a few ros2 topic echo HOT 2
- Are services supported with EmbeddedRTPS? HOT 2
- Fix the build system
- multithread issue publisher HOT 3
- Unable to create more than 2 publishers HOT 2
- cant find CONFIG_MICRO_ROS_APP_STACK and CONFIG_MICRO_ROS_APP_TASK_PRIO during build HOT 1
- addtwoints_server does not create node/service HOT 2
- Micro-ros Ping utility issue HOT 9
- Unable to build libmicroros.a correctly HOT 2
- microcdr C_STANDARD is set to invalid value '17' HOT 14
- Services getting random values from caller HOT 8
- Can't create subscriber on ESP32-C3 HOT 3
- An error is reported using the int32_publisher example βFailed status on line 54: 1. Aborting.β HOT 2
- ESP32 create subscriber for sensor_msgs/msg/Joy did not work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro_ros_espidf_component.