Skip to content

Commit

Permalink
refine params
Browse files Browse the repository at this point in the history
  • Loading branch information
takasehideki committed Feb 25, 2022
1 parent ad73c22 commit 7b45d38
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions micro-ros-stm32_embeddedrtps/main_twist.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ geometry_msgs__msg__Twist msg;

void subscription_callback(const void * msgin)
{
//printf("sub\n");
//printf("sub\r\n");

const geometry_msgs__msg__Twist * msg = (const geometry_msgs__msg__Twist *)msgin;

Expand Down Expand Up @@ -394,7 +394,7 @@ void StartDefaultTask(void *argument)
printf("Error on default allocators (line %d)\n", __LINE__);
}

printf("main start\n");
printf("main start\r\n");

// micro-ROS app

Expand Down Expand Up @@ -444,7 +444,7 @@ void StartDefaultTask(void *argument)

for(;;) {
rclc_executor_spin_some(&executor, RCL_MS_TO_NS(10));
osDelay(1000);
osDelay(10);
}
/* USER CODE END 5 */
}
Expand Down
6 changes: 3 additions & 3 deletions micro-ros-stm32_embeddedrtps/main_uint16.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ std_msgs__msg__UInt16 msg;

void subscription_callback(const void * msgin)
{
//printf("sub\n");
//printf("sub\r\n");

const std_msgs__msg__UInt16 * msg = (const std_msgs__msg__UInt16 *)msgin;

Expand Down Expand Up @@ -394,7 +394,7 @@ void StartDefaultTask(void *argument)
printf("Error on default allocators (line %d)\n", __LINE__);
}

printf("main start\n");
printf("main start\r\n");

// micro-ROS app

Expand Down Expand Up @@ -444,7 +444,7 @@ void StartDefaultTask(void *argument)

for(;;) {
rclc_executor_spin_some(&executor, RCL_MS_TO_NS(10));
osDelay(1000);
osDelay(10);
}
/* USER CODE END 5 */
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <rclc/rclc.h>
#include <rclc/executor.h>

#include <geometry_msgs/msg/twist.h>
#include <std_msgs/msg/u_int16.h>
/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
Expand Down Expand Up @@ -362,13 +362,13 @@ void * microros_zero_allocate(size_t number_of_elements, size_t size_of_element,
rcl_publisher_t publisher;
rcl_subscription_t subscriber;

geometry_msgs__msg__Twist msg;
std_msgs__msg__UInt16 msg;

void subscription_callback(const void * msgin)
{
//printf("sub\n");
//printf("sub\r\n");

const geometry_msgs__msg__Twist * msg = (const geometry_msgs__msg__Twist *)msgin;
const std_msgs__msg__UInt16 * msg = (const std_msgs__msg__UInt16 *)msgin;

rcl_publish(&publisher, (const void*)msg, NULL);
}
Expand All @@ -394,7 +394,7 @@ void StartDefaultTask(void *argument)
printf("Error on default allocators (line %d)\n", __LINE__);
}

printf("main start\n");
printf("main start\r\n");

// micro-ROS app

Expand All @@ -414,14 +414,14 @@ void StartDefaultTask(void *argument)
rclc_publisher_init_default(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(geometry_msgs, msg, Twist),
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, UInt16),
"to_linux");

// create subscriber
rclc_subscription_init_default(
&subscriber,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(geometry_msgs, msg, Twist),
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, UInt16),
"to_stm");

// Create executor
Expand All @@ -444,7 +444,7 @@ void StartDefaultTask(void *argument)

for(;;) {
rclc_executor_spin_some(&executor, RCL_MS_TO_NS(10));
osDelay(1000);
osDelay(10);
}
/* USER CODE END 5 */
}
Expand Down

0 comments on commit 7b45d38

Please sign in to comment.